summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-04-10 16:55:57 +0000
committerSanjay Patel <spatel@rotateright.com>2017-04-10 16:55:57 +0000
commit570e35c1570a21d98f8fce9378bfdbc36482968a (patch)
tree15599cb0b1001c628c817cabf905bc264733cecd /llvm/test
parent08126372e3363ce8ec27d345dbd6fb518be5f0b4 (diff)
downloadbcm5719-llvm-570e35c1570a21d98f8fce9378bfdbc36482968a.tar.gz
bcm5719-llvm-570e35c1570a21d98f8fce9378bfdbc36482968a.zip
[InstCombine] fix matching of or-of-icmps constants (PR32524)
Also, make the same change in and-of-icmps and remove a hack for detecting that case. Finally, add some FIXME comments because the code duplication here is awful. This should fix the remaining IR problem noted in: https://bugs.llvm.org/show_bug.cgi?id=32524 llvm-svn: 299851
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstCombine/or.ll7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/test/Transforms/InstCombine/or.ll b/llvm/test/Transforms/InstCombine/or.ll
index 2ac6f5b1104..64835ea9b83 100644
--- a/llvm/test/Transforms/InstCombine/or.ll
+++ b/llvm/test/Transforms/InstCombine/or.ll
@@ -223,10 +223,9 @@ define i1 @test19(i32 %A) {
define i1 @or_icmps_eq_diff1(i32 %x) {
; CHECK-LABEL: @or_icmps_eq_diff1(
-; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32 %x, -1
-; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i32 %x, 0
-; CHECK-NEXT: [[LOGIC:%.*]] = or i1 [[CMP1]], [[CMP2]]
-; CHECK-NEXT: ret i1 [[LOGIC]]
+; CHECK-NEXT: [[X_OFF:%.*]] = add i32 %x, 1
+; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i32 [[X_OFF]], 2
+; CHECK-NEXT: ret i1 [[TMP1]]
;
%cmp1 = icmp eq i32 %x, -1
%cmp2 = icmp eq i32 %x, 0
OpenPOWER on IntegriCloud