From: David Bolvansky Date: Wed, 4 Sep 2019 11:44:00 +0000 (+0000) Subject: [NFC] Added a new test for D67153 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=720b5e540414f88df955506008234b8fff5b6901;p=llvm [NFC] Added a new test for D67153 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370881 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Transforms/InstCombine/sub-or-and-xor.ll b/test/Transforms/InstCombine/sub-or-and-xor.ll index d59da5aaa68..59fe79550a7 100644 --- a/test/Transforms/InstCombine/sub-or-and-xor.ll +++ b/test/Transforms/InstCombine/sub-or-and-xor.ll @@ -74,6 +74,19 @@ define i32 @sub_to_xor_or_commuted(i32 %x, i32 %y) { 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:%.*]]