From: David Bolvansky Date: Wed, 4 Sep 2019 11:44:00 +0000 (+0000) Subject: [NFC] Added a new test for D67153 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54f3a651f3af31498014c5f5232b024fe4995eae;p=platform%2Fupstream%2Fllvm.git [NFC] Added a new test for D67153 llvm-svn: 370881 --- diff --git a/llvm/test/Transforms/InstCombine/sub-or-and-xor.ll b/llvm/test/Transforms/InstCombine/sub-or-and-xor.ll index d59da5a..59fe795 100644 --- a/llvm/test/Transforms/InstCombine/sub-or-and-xor.ll +++ b/llvm/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:%.*]]