diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2017-05-17 22:29:40 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2017-05-17 22:29:40 +0000 |
| commit | ba212c241ab233b4830941f36c4608bee4eca4a3 (patch) | |
| tree | 8c1104adf5fc61d6858fac8f47f5af2af98ca9fe /llvm/test | |
| parent | cde4b3f4e694b544521e40dada45025ed0196afa (diff) | |
| download | bcm5719-llvm-ba212c241ab233b4830941f36c4608bee4eca4a3.tar.gz bcm5719-llvm-ba212c241ab233b4830941f36c4608bee4eca4a3.zip | |
[InstCombine] handle icmp i1 X, C early to avoid creating an unknown pattern
The missing optimization for xor-of-icmps still needs to be added, but by
being more efficient (not generating unnecessary logic ops with constants)
we avoid the bug.
See discussion in post-commit comments:
https://reviews.llvm.org/D32143
llvm-svn: 303312
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/set.ll | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/test/Transforms/InstCombine/set.ll b/llvm/test/Transforms/InstCombine/set.ll index f1bbc6cda0b..5955eaea2c2 100644 --- a/llvm/test/Transforms/InstCombine/set.ll +++ b/llvm/test/Transforms/InstCombine/set.ll @@ -152,10 +152,8 @@ define <3 x i1> @test14vec(<3 x i1> %A, <3 x i1> %B) { define i1 @bool_eq0(i64 %a) { ; CHECK-LABEL: @bool_eq0( -; CHECK-NEXT: [[B:%.*]] = icmp sgt i64 %a, 0 -; CHECK-NEXT: [[C:%.*]] = icmp eq i64 %a, 1 -; CHECK-NEXT: [[AND:%.*]] = xor i1 [[C]], [[B]] -; CHECK-NEXT: ret i1 [[AND]] +; CHECK-NEXT: [[TMP1:%.*]] = icmp sgt i64 %a, 1 +; CHECK-NEXT: ret i1 [[TMP1]] ; %b = icmp sgt i64 %a, 0 %c = icmp eq i64 %a, 1 |

