[llvm] r308103 - [InstCombine] Move 4 test cases from a test that didn't use FileCheck and merge them into a existing test file. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 15 10:09:22 PDT 2017


Author: ctopper
Date: Sat Jul 15 10:09:22 2017
New Revision: 308103

URL: http://llvm.org/viewvc/llvm-project?rev=308103&view=rev
Log:
[InstCombine] Move 4 test cases from a test that didn't use FileCheck and merge them into a existing test file. NFC

Removed:
    llvm/trunk/test/Transforms/InstCombine/and-not-or.ll
Modified:
    llvm/trunk/test/Transforms/InstCombine/and.ll

Removed: llvm/trunk/test/Transforms/InstCombine/and-not-or.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/and-not-or.ll?rev=308102&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/and-not-or.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/and-not-or.ll (removed)
@@ -1,34 +0,0 @@
-; RUN: opt < %s -instcombine -S | grep "and i32 %x, %y" | count 4
-; RUN: opt < %s -instcombine -S | not grep "or"
-
-define i32 @func1(i32 %x, i32 %y) nounwind {
-entry:
-	%n = xor i32 %y, -1
-	%o = or i32 %n, %x
-	%a = and i32 %o, %y
-	ret i32 %a
-}
-
-define i32 @func2(i32 %x, i32 %y) nounwind {
-entry:
-	%n = xor i32 %y, -1
-	%o = or i32 %x, %n
-	%a = and i32 %o, %y
-	ret i32 %a
-}
-
-define i32 @func3(i32 %x, i32 %y) nounwind {
-entry:
-	%n = xor i32 %y, -1
-	%o = or i32 %n, %x
-	%a = and i32 %y, %o
-	ret i32 %a
-}
-
-define i32 @func4(i32 %x, i32 %y) nounwind {
-entry:
-	%n = xor i32 %y, -1
-	%o = or i32 %x, %n
-	%a = and i32 %y, %o
-	ret i32 %a
-}

Modified: llvm/trunk/test/Transforms/InstCombine/and.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/and.ll?rev=308103&r1=308102&r2=308103&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/and.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/and.ll Sat Jul 15 10:09:22 2017
@@ -628,3 +628,51 @@ define i32 @test43(i32 %a, i32 %c, i32 %
   %and = and i32 %or, %xor
   ret i32 %and
 }
+
+; (~y | x) & y -> x & y
+define i32 @test44(i32 %x, i32 %y) nounwind {
+; CHECK-LABEL: @test44(
+; CHECK-NEXT:    [[A:%.*]] = and i32 [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT:    ret i32 [[A]]
+;
+  %n = xor i32 %y, -1
+  %o = or i32 %n, %x
+  %a = and i32 %o, %y
+  ret i32 %a
+}
+
+; (x | ~y) & y -> x & y
+define i32 @test45(i32 %x, i32 %y) nounwind {
+; CHECK-LABEL: @test45(
+; CHECK-NEXT:    [[A:%.*]] = and i32 [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT:    ret i32 [[A]]
+;
+  %n = xor i32 %y, -1
+  %o = or i32 %x, %n
+  %a = and i32 %o, %y
+  ret i32 %a
+}
+
+; y & (~y | x) -> y | x
+define i32 @test46(i32 %x, i32 %y) nounwind {
+; CHECK-LABEL: @test46(
+; CHECK-NEXT:    [[A:%.*]] = and i32 [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT:    ret i32 [[A]]
+;
+  %n = xor i32 %y, -1
+  %o = or i32 %n, %x
+  %a = and i32 %y, %o
+  ret i32 %a
+}
+
+; y & (x | ~y) -> y | x
+define i32 @test47(i32 %x, i32 %y) nounwind {
+; CHECK-LABEL: @test47(
+; CHECK-NEXT:    [[A:%.*]] = and i32 [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT:    ret i32 [[A]]
+;
+  %n = xor i32 %y, -1
+  %o = or i32 %x, %n
+  %a = and i32 %y, %o
+  ret i32 %a
+}




More information about the llvm-commits mailing list