1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/Transforms/InstCombine/sdiv-1.ll
Eric Christopher a62270de2c Revert "Temporarily Revert "Add basic loop fusion pass.""
The reversion apparently deleted the test/Transforms directory.

Will be re-reverting again.

llvm-svn: 358552
2019-04-17 04:52:47 +00:00

32 lines
667 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instcombine -inline -S | FileCheck %s
; PR3142
define i32 @a(i32 %X) {
; CHECK-LABEL: @a(
; CHECK-NEXT: [[T0:%.*]] = sub i32 0, [[X:%.*]]
; CHECK-NEXT: [[T1:%.*]] = sdiv i32 [[T0]], -3
; CHECK-NEXT: ret i32 [[T1]]
;
%t0 = sub i32 0, %X
%t1 = sdiv i32 %t0, -3
ret i32 %t1
}
define i32 @b(i32 %X) {
; CHECK-LABEL: @b(
; CHECK-NEXT: ret i32 715827882
;
%t0 = call i32 @a(i32 -2147483648)
ret i32 %t0
}
define i32 @c(i32 %X) {
; CHECK-LABEL: @c(
; CHECK-NEXT: ret i32 715827882
;
%t0 = sub i32 0, -2147483648
%t1 = sdiv i32 %t0, -3
ret i32 %t1
}