diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-02-03 21:43:34 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-02-03 21:43:34 +0000 |
commit | 73fc8ddb065112fbb7cad1453774ed96bbb7d6e3 (patch) | |
tree | ba2c3ab04aba252f1c73bad9b5a480c056530f0f /llvm/test/Transforms/InstCombine/add.ll | |
parent | 25324313325e906368fafd142bc6138c231e0b44 (diff) | |
download | bcm5719-llvm-73fc8ddb065112fbb7cad1453774ed96bbb7d6e3.tar.gz bcm5719-llvm-73fc8ddb065112fbb7cad1453774ed96bbb7d6e3.zip |
[InstCombine] fix operand-complexity-based canonicalization (PR28296)
The code comments didn't match the code logic, and we didn't actually distinguish the fake unary (not/neg/fneg)
operators from arguments. Adding another level to the weighting scheme provides more structure and can help
simplify the pattern matching in InstCombine and other places.
I fixed regressions that would have shown up from this change in:
rL290067
rL290127
But that doesn't mean there are no pattern-matching logic holes left; some combines may just be missing regression tests.
Should fix:
https://llvm.org/bugs/show_bug.cgi?id=28296
Differential Revision: https://reviews.llvm.org/D27933
llvm-svn: 294049
Diffstat (limited to 'llvm/test/Transforms/InstCombine/add.ll')
-rw-r--r-- | llvm/test/Transforms/InstCombine/add.ll | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstCombine/add.ll b/llvm/test/Transforms/InstCombine/add.ll index 39a746ab310..3ea78492470 100644 --- a/llvm/test/Transforms/InstCombine/add.ll +++ b/llvm/test/Transforms/InstCombine/add.ll @@ -100,7 +100,7 @@ define i32 @test9(i32 %A) { define i1 @test10(i8 %A, i8 %b) { ; CHECK-LABEL: @test10( ; CHECK-NEXT: [[B:%.*]] = sub i8 0, %b -; CHECK-NEXT: [[C:%.*]] = icmp ne i8 %A, [[B]] +; CHECK-NEXT: [[C:%.*]] = icmp ne i8 [[B]], %A ; CHECK-NEXT: ret i1 [[C]] ; %B = add i8 %A, %b @@ -112,7 +112,7 @@ define i1 @test10(i8 %A, i8 %b) { define <2 x i1> @test10vec(<2 x i8> %a, <2 x i8> %b) { ; CHECK-LABEL: @test10vec( ; CHECK-NEXT: [[C:%.*]] = sub <2 x i8> zeroinitializer, %b -; CHECK-NEXT: [[D:%.*]] = icmp ne <2 x i8> %a, [[C]] +; CHECK-NEXT: [[D:%.*]] = icmp ne <2 x i8> [[C]], %a ; CHECK-NEXT: ret <2 x i1> [[D]] ; %c = add <2 x i8> %a, %b |