[llvm-commits] [llvm] r112289 - in /llvm/trunk/test/Transforms/InstCombine: shift-simplify.ll shift.ll

Chris Lattner sabre at nondot.org
Fri Aug 27 13:44:45 PDT 2010


Author: lattner
Date: Fri Aug 27 15:44:45 2010
New Revision: 112289

URL: http://llvm.org/viewvc/llvm-project?rev=112289&view=rev
Log:
merge and filecheckize test

Removed:
    llvm/trunk/test/Transforms/InstCombine/shift-simplify.ll
Modified:
    llvm/trunk/test/Transforms/InstCombine/shift.ll

Removed: llvm/trunk/test/Transforms/InstCombine/shift-simplify.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/shift-simplify.ll?rev=112288&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/shift-simplify.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/shift-simplify.ll (removed)
@@ -1,42 +0,0 @@
-; RUN: opt < %s -instcombine -S | \
-; RUN:    egrep {shl|lshr|ashr} | count 3
-
-define i32 @test0(i32 %A, i32 %B, i32 %C) {
-	%X = shl i32 %A, %C
-	%Y = shl i32 %B, %C
-	%Z = and i32 %X, %Y
-	ret i32 %Z
-}
-
-define i32 @test1(i32 %A, i32 %B, i32 %C) {
-	%X = lshr i32 %A, %C
-	%Y = lshr i32 %B, %C
-	%Z = or i32 %X, %Y
-	ret i32 %Z
-}
-
-define i32 @test2(i32 %A, i32 %B, i32 %C) {
-	%X = ashr i32 %A, %C
-	%Y = ashr i32 %B, %C
-	%Z = xor i32 %X, %Y
-	ret i32 %Z
-}
-
-define i1 @test3(i32 %X) {
-        %tmp1 = shl i32 %X, 7
-        %tmp2 = icmp slt i32 %tmp1, 0
-        ret i1 %tmp2
-}
-
-define i1 @test4(i32 %X) {
-        %tmp1 = lshr i32 %X, 7
-        %tmp2 = icmp slt i32 %tmp1, 0
-        ret i1 %tmp2
-}
-
-define i1 @test5(i32 %X) {
-        %tmp1 = ashr i32 %X, 7
-        %tmp2 = icmp slt i32 %tmp1, 0
-        ret i1 %tmp2
-}
-

Modified: llvm/trunk/test/Transforms/InstCombine/shift.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/shift.ll?rev=112289&r1=112288&r2=112289&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/shift.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/shift.ll Fri Aug 27 15:44:45 2010
@@ -355,3 +355,60 @@
 }
 
 
+define i32 @test30(i32 %A, i32 %B, i32 %C) {
+	%X = shl i32 %A, %C
+	%Y = shl i32 %B, %C
+	%Z = and i32 %X, %Y
+	ret i32 %Z
+; CHECK: @test30
+; CHECK: %X1 = and i32 %A, %B
+; CHECK: %Z = shl i32 %X1, %C
+}
+
+define i32 @test31(i32 %A, i32 %B, i32 %C) {
+	%X = lshr i32 %A, %C
+	%Y = lshr i32 %B, %C
+	%Z = or i32 %X, %Y
+	ret i32 %Z
+; CHECK: @test31
+; CHECK: %X1 = or i32 %A, %B
+; CHECK: %Z = lshr i32 %X1, %C
+}
+
+define i32 @test32(i32 %A, i32 %B, i32 %C) {
+	%X = ashr i32 %A, %C
+	%Y = ashr i32 %B, %C
+	%Z = xor i32 %X, %Y
+	ret i32 %Z
+; CHECK: @test32
+; CHECK: %X1 = xor i32 %A, %B
+; CHECK: %Z = ashr i32 %X1, %C
+; CHECK: ret i32 %Z
+}
+
+define i1 @test33(i32 %X) {
+        %tmp1 = shl i32 %X, 7
+        %tmp2 = icmp slt i32 %tmp1, 0
+        ret i1 %tmp2
+; CHECK: @test33
+; CHECK: %tmp1.mask = and i32 %X, 16777216
+; CHECK: %tmp2 = icmp ne i32 %tmp1.mask, 0
+}
+
+define i1 @test34(i32 %X) {
+        %tmp1 = lshr i32 %X, 7
+        %tmp2 = icmp slt i32 %tmp1, 0
+        ret i1 %tmp2
+; CHECK: @test34
+; CHECK: ret i1 false
+}
+
+define i1 @test35(i32 %X) {
+        %tmp1 = ashr i32 %X, 7
+        %tmp2 = icmp slt i32 %tmp1, 0
+        ret i1 %tmp2
+; CHECK: @test35
+; CHECK: %tmp2 = icmp slt i32 %X, 0
+; CHECK: ret i1 %tmp2
+}
+





More information about the llvm-commits mailing list