[llvm] r278867 - [InstCombine] add tests for fold with no coverage and missing vector fold

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 16:18:42 PDT 2016


Author: spatel
Date: Tue Aug 16 18:18:42 2016
New Revision: 278867

URL: http://llvm.org/viewvc/llvm-project?rev=278867&view=rev
Log:
[InstCombine] add tests for fold with no coverage and missing vector fold

Modified:
    llvm/trunk/test/Transforms/InstCombine/2008-01-29-AddICmp.ll

Modified: llvm/trunk/test/Transforms/InstCombine/2008-01-29-AddICmp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2008-01-29-AddICmp.ll?rev=278867&r1=278866&r2=278867&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/2008-01-29-AddICmp.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/2008-01-29-AddICmp.ll Tue Aug 16 18:18:42 2016
@@ -67,3 +67,24 @@ define <2 x i1> @test3vec(<2 x i32> %a)
   ret <2 x i1> %c
 }
 
+define i1 @test4(i32 %a) {
+; CHECK-LABEL: @test4(
+; CHECK-NEXT:    [[C:%.*]] = icmp slt i32 %a, -4
+; CHECK-NEXT:    ret i1 [[C]]
+;
+  %b = add i32 %a, 2147483652
+  %c = icmp sge i32 %b, 4
+  ret i1 %c
+}
+
+define <2 x i1> @test4vec(<2 x i32> %a) {
+; CHECK-LABEL: @test4vec(
+; CHECK-NEXT:    [[B:%.*]] = add <2 x i32> %a, <i32 -2147483644, i32 -2147483644>
+; CHECK-NEXT:    [[C:%.*]] = icmp sgt <2 x i32> [[B]], <i32 3, i32 3>
+; CHECK-NEXT:    ret <2 x i1> [[C]]
+;
+  %b = add <2 x i32> %a, <i32 2147483652, i32 2147483652>
+  %c = icmp sge <2 x i32> %b, <i32 4, i32 4>
+  ret <2 x i1> %c
+}
+




More information about the llvm-commits mailing list