diff options
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/or-xor.ll | 23 | ||||
| -rw-r--r-- | llvm/test/Transforms/InstCombine/or.ll | 23 | ||||
| -rw-r--r-- | llvm/test/Transforms/InstCombine/xor2.ll | 18 |
3 files changed, 13 insertions, 51 deletions
diff --git a/llvm/test/Transforms/InstCombine/or-xor.ll b/llvm/test/Transforms/InstCombine/or-xor.ll index 3ba51de7108..ec5b71656a4 100644 --- a/llvm/test/Transforms/InstCombine/or-xor.ll +++ b/llvm/test/Transforms/InstCombine/or-xor.ll @@ -140,14 +140,9 @@ define i32 @test12(i32 %x, i32 %y) { ret i32 %and } -; FIXME: We miss the fold because the pattern matching is inadequate. - define i32 @test12_commuted(i32 %x, i32 %y) { ; CHECK-LABEL: @test12_commuted( -; CHECK-NEXT: [[NEG:%.*]] = xor i32 %x, -1 -; CHECK-NEXT: [[XOR:%.*]] = xor i32 [[NEG]], %y -; CHECK-NEXT: [[OR:%.*]] = or i32 %y, %x -; CHECK-NEXT: [[AND:%.*]] = and i32 [[XOR]], [[OR]] +; CHECK-NEXT: [[AND:%.*]] = and i32 %x, %y ; CHECK-NEXT: ret i32 [[AND]] ; %neg = xor i32 %x, -1 @@ -183,15 +178,9 @@ define i32 @test14(i32 %x, i32 %y) { ret i32 %xor } -; FIXME: We miss the fold because the pattern matching is inadequate. - define i32 @test14_commuted(i32 %x, i32 %y) { ; CHECK-LABEL: @test14_commuted( -; CHECK-NEXT: [[NOTY:%.*]] = xor i32 %y, -1 -; CHECK-NEXT: [[NOTX:%.*]] = xor i32 %x, -1 -; CHECK-NEXT: [[OR1:%.*]] = or i32 [[NOTY]], %x -; CHECK-NEXT: [[OR2:%.*]] = or i32 [[NOTX]], %y -; CHECK-NEXT: [[XOR:%.*]] = xor i32 [[OR1]], [[OR2]] +; CHECK-NEXT: [[XOR:%.*]] = xor i32 %x, %y ; CHECK-NEXT: ret i32 [[XOR]] ; %noty = xor i32 %y, -1 @@ -216,15 +205,9 @@ define i32 @test15(i32 %x, i32 %y) { ret i32 %xor } -; FIXME: We miss the fold because the pattern matching is inadequate. - define i32 @test15_commuted(i32 %x, i32 %y) { ; CHECK-LABEL: @test15_commuted( -; CHECK-NEXT: [[NOTY:%.*]] = xor i32 %y, -1 -; CHECK-NEXT: [[NOTX:%.*]] = xor i32 %x, -1 -; CHECK-NEXT: [[AND1:%.*]] = and i32 [[NOTY]], %x -; CHECK-NEXT: [[AND2:%.*]] = and i32 [[NOTX]], %y -; CHECK-NEXT: [[XOR:%.*]] = xor i32 [[AND1]], [[AND2]] +; CHECK-NEXT: [[XOR:%.*]] = xor i32 %x, %y ; CHECK-NEXT: ret i32 [[XOR]] ; %noty = xor i32 %y, -1 diff --git a/llvm/test/Transforms/InstCombine/or.ll b/llvm/test/Transforms/InstCombine/or.ll index 38b8ebc5adf..facd63019fe 100644 --- a/llvm/test/Transforms/InstCombine/or.ll +++ b/llvm/test/Transforms/InstCombine/or.ll @@ -570,14 +570,10 @@ define i32 @test42(i32 %a, i32 %b) { ret i32 %or } -; FIXME: We miss the fold because the pattern matching is inadequate. - define i32 @test42_commuted_and(i32 %a, i32 %b) { ; CHECK-LABEL: @test42_commuted_and( -; CHECK-NEXT: [[NEGA:%.*]] = xor i32 %a, -1 -; CHECK-NEXT: [[XOR:%.*]] = xor i32 [[NEGA]], %b -; CHECK-NEXT: [[AND:%.*]] = and i32 %b, %a -; CHECK-NEXT: [[OR:%.*]] = or i32 [[XOR]], [[AND]] +; CHECK-NEXT: [[TMP1:%.*]] = xor i32 %a, -1 +; CHECK-NEXT: [[OR:%.*]] = xor i32 [[TMP1]], %b ; CHECK-NEXT: ret i32 [[OR]] ; %nega = xor i32 %a, -1 @@ -587,14 +583,10 @@ define i32 @test42_commuted_and(i32 %a, i32 %b) { ret i32 %or } -; FIXME: We miss the fold because the pattern matching is inadequate. - define i32 @test42_commuted_xor(i32 %a, i32 %b) { ; CHECK-LABEL: @test42_commuted_xor( -; CHECK-NEXT: [[NEGA:%.*]] = xor i32 %a, -1 -; CHECK-NEXT: [[XOR:%.*]] = xor i32 %b, [[NEGA]] -; CHECK-NEXT: [[AND:%.*]] = and i32 %a, %b -; CHECK-NEXT: [[OR:%.*]] = or i32 [[XOR]], [[AND]] +; CHECK-NEXT: [[TMP1:%.*]] = xor i32 %a, -1 +; CHECK-NEXT: [[OR:%.*]] = xor i32 [[TMP1]], %b ; CHECK-NEXT: ret i32 [[OR]] ; %nega = xor i32 %a, -1 @@ -618,14 +610,9 @@ define i32 @test43(i32 %a, i32 %b) { ret i32 %or } -; FIXME: We miss the fold because the pattern matching is inadequate. - define i32 @test43_commuted_and(i32 %a, i32 %b) { ; CHECK-LABEL: @test43_commuted_and( -; CHECK-NEXT: [[NEG:%.*]] = xor i32 %b, -1 -; CHECK-NEXT: [[AND:%.*]] = and i32 [[NEG]], %a -; CHECK-NEXT: [[XOR:%.*]] = xor i32 %a, %b -; CHECK-NEXT: [[OR:%.*]] = or i32 [[AND]], [[XOR]] +; CHECK-NEXT: [[OR:%.*]] = xor i32 %a, %b ; CHECK-NEXT: ret i32 [[OR]] ; %neg = xor i32 %b, -1 diff --git a/llvm/test/Transforms/InstCombine/xor2.ll b/llvm/test/Transforms/InstCombine/xor2.ll index 7ec84d8caf9..f3591ed9c8a 100644 --- a/llvm/test/Transforms/InstCombine/xor2.ll +++ b/llvm/test/Transforms/InstCombine/xor2.ll @@ -180,14 +180,10 @@ define i32 @test12(i32 %a, i32 %b) { ret i32 %xor } -; FIXME: We miss the fold because the pattern matching is inadequate. - define i32 @test12commuted(i32 %a, i32 %b) { ; CHECK-LABEL: @test12commuted( -; CHECK-NEXT: [[NEGB:%.*]] = xor i32 %b, -1 -; CHECK-NEXT: [[AND:%.*]] = and i32 [[NEGB]], %a -; CHECK-NEXT: [[NEGA:%.*]] = xor i32 %a, -1 -; CHECK-NEXT: [[XOR:%.*]] = xor i32 [[AND]], [[NEGA]] +; CHECK-NEXT: [[TMP1:%.*]] = and i32 %a, %b +; CHECK-NEXT: [[XOR:%.*]] = xor i32 [[TMP1]], -1 ; CHECK-NEXT: ret i32 [[XOR]] ; %negb = xor i32 %b, -1 @@ -198,7 +194,7 @@ define i32 @test12commuted(i32 %a, i32 %b) { } ; This is a test of canonicalization via operand complexity. -; The final xor has a binary operator and a (fake) unary operator, +; The final xor has a binary operator and a (fake) unary operator, ; so binary (more complex) should come first. define i32 @test13(i32 %a, i32 %b) { @@ -214,14 +210,10 @@ define i32 @test13(i32 %a, i32 %b) { ret i32 %xor } -; FIXME: We miss the fold because the pattern matching is inadequate. - define i32 @test13commuted(i32 %a, i32 %b) { ; CHECK-LABEL: @test13commuted( -; CHECK-NEXT: [[NEGA:%.*]] = xor i32 %a, -1 -; CHECK-NEXT: [[NEGB:%.*]] = xor i32 %b, -1 -; CHECK-NEXT: [[AND:%.*]] = and i32 [[NEGB]], %a -; CHECK-NEXT: [[XOR:%.*]] = xor i32 [[AND]], [[NEGA]] +; CHECK-NEXT: [[TMP1:%.*]] = and i32 %a, %b +; CHECK-NEXT: [[XOR:%.*]] = xor i32 [[TMP1]], -1 ; CHECK-NEXT: ret i32 [[XOR]] ; %nega = xor i32 %a, -1 |

