[llvm] r269803 - [InstCombine] add test for wrong icmp constant (PR27792)

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 12:25:56 PDT 2016


Author: spatel
Date: Tue May 17 14:25:55 2016
New Revision: 269803

URL: http://llvm.org/viewvc/llvm-project?rev=269803&view=rev
Log:
[InstCombine] add test for wrong icmp constant (PR27792)

The code fix for this was checked in at r269797.


Modified:
    llvm/trunk/test/Transforms/InstCombine/icmp.ll

Modified: llvm/trunk/test/Transforms/InstCombine/icmp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/icmp.ll?rev=269803&r1=269802&r2=269803&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/icmp.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/icmp.ll Tue May 17 14:25:55 2016
@@ -2097,3 +2097,15 @@ if.then3:
 return:                                           ; preds = %if.end, %entry, %if.then3
   ret void
 }
+
+; When canonicalizing to 'sgt', make sure the constant is correct.
+
+define i1 @PR27792(i128 %a) {
+; CHECK-LABEL: @PR27792(
+; CHECK-NEXT:    [[CMP:%.*]] = icmp sgt i128 %a, -1
+; CHECK-NEXT:    ret i1 [[CMP]]
+;
+  %cmp = icmp sge i128 %a, 0
+  ret i1 %cmp
+}
+




More information about the llvm-commits mailing list