diff options
Diffstat (limited to 'test/Transforms/InstCombine/icmp.ll')
-rw-r--r-- | test/Transforms/InstCombine/icmp.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/icmp.ll b/test/Transforms/InstCombine/icmp.ll index edfa9a102917f..6f657b1904542 100644 --- a/test/Transforms/InstCombine/icmp.ll +++ b/test/Transforms/InstCombine/icmp.ll @@ -695,6 +695,21 @@ define i1 @test48(i32 %X, i32 %Y, i32 %Z) { ret i1 %C } +; The above transform only works for equality predicates. + +define i1 @PR32949(i32 %X, i32 %Y, i32 %Z) { +; CHECK-LABEL: @PR32949( +; CHECK-NEXT: [[A:%.*]] = sdiv exact i32 %X, %Z +; CHECK-NEXT: [[B:%.*]] = sdiv exact i32 %Y, %Z +; CHECK-NEXT: [[C:%.*]] = icmp sgt i32 [[A]], [[B]] +; CHECK-NEXT: ret i1 [[C]] +; + %A = sdiv exact i32 %X, %Z + %B = sdiv exact i32 %Y, %Z + %C = icmp sgt i32 %A, %B + ret i1 %C +} + ; PR8469 define <2 x i1> @test49(<2 x i32> %tmp3) { ; CHECK-LABEL: @test49( |