[llvm] r370881 - [NFC] Added a new test for D67153

David Bolvansky via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 04:44:00 PDT 2019


Author: xbolva00
Date: Wed Sep  4 04:44:00 2019
New Revision: 370881

URL: http://llvm.org/viewvc/llvm-project?rev=370881&view=rev
Log:
[NFC] Added a new test for D67153

Modified:
    llvm/trunk/test/Transforms/InstCombine/sub-or-and-xor.ll

Modified: llvm/trunk/test/Transforms/InstCombine/sub-or-and-xor.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/sub-or-and-xor.ll?rev=370881&r1=370880&r2=370881&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/sub-or-and-xor.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/sub-or-and-xor.ll Wed Sep  4 04:44:00 2019
@@ -74,6 +74,19 @@ define i32 @sub_to_xor_or_commuted(i32 %
   ret i32 %sub
 }
 
+define i32 @sub_to_xor_and_commuted(i32 %x, i32 %y) {
+; CHECK-LABEL: @sub_to_xor_and_commuted(
+; CHECK-NEXT:    [[OR:%.*]] = or i32 [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT:    [[AND:%.*]] = and i32 [[Y]], [[X]]
+; CHECK-NEXT:    [[SUB:%.*]] = sub i32 [[OR]], [[AND]]
+; CHECK-NEXT:    ret i32 [[SUB]]
+;
+  %or = or i32 %x, %y
+  %and = and i32 %y, %x
+  %sub = sub i32 %or, %and
+  ret i32 %sub
+}
+
 define <2 x i32> @sub_to_xor_vec(<2 x i32> %x, <2 x i32> %y) {
 ; CHECK-LABEL: @sub_to_xor_vec(
 ; CHECK-NEXT:    [[OR:%.*]] = or <2 x i32> [[X:%.*]], [[Y:%.*]]




More information about the llvm-commits mailing list