summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-09-16 15:33:40 +0000
committerSanjay Patel <spatel@rotateright.com>2019-09-16 15:33:40 +0000
commit4d9d0f9cf532ec40f07178693f1c37049c18bc79 (patch)
treea01cad80fa1edc7baf3e37fe5680a6059d83a43f
parentee6fbebbaff5af0a0fbe58a0e33ef191340223ea (diff)
downloadbcm5719-llvm-4d9d0f9cf532ec40f07178693f1c37049c18bc79.tar.gz
bcm5719-llvm-4d9d0f9cf532ec40f07178693f1c37049c18bc79.zip
[InstCombine] move tests for icmp+add; NFC
llvm-svn: 372004
-rw-r--r--llvm/test/Transforms/InstCombine/2009-01-31-Pressure.ll22
-rw-r--r--llvm/test/Transforms/InstCombine/icmp-add.ll35
2 files changed, 35 insertions, 22 deletions
diff --git a/llvm/test/Transforms/InstCombine/2009-01-31-Pressure.ll b/llvm/test/Transforms/InstCombine/2009-01-31-Pressure.ll
deleted file mode 100644
index 666b02e8ed0..00000000000
--- a/llvm/test/Transforms/InstCombine/2009-01-31-Pressure.ll
+++ /dev/null
@@ -1,22 +0,0 @@
-; RUN: opt < %s -instcombine -S | grep "%B = add i8 %b, %x"
-; PR2698
-
-declare void @use1(i1)
-declare void @use8(i8)
-
-define void @test1(i8 %a, i8 %b, i8 %x) {
- %A = add i8 %a, %x
- %B = add i8 %b, %x
- %C = icmp eq i8 %A, %B
- call void @use1(i1 %C)
- ret void
-}
-
-define void @test2(i8 %a, i8 %b, i8 %x) {
- %A = add i8 %a, %x
- %B = add i8 %b, %x
- %C = icmp eq i8 %A, %B
- call void @use1(i1 %C)
- call void @use8(i8 %A)
- ret void
-}
diff --git a/llvm/test/Transforms/InstCombine/icmp-add.ll b/llvm/test/Transforms/InstCombine/icmp-add.ll
index 87e01d2b3d5..ffbfbabd428 100644
--- a/llvm/test/Transforms/InstCombine/icmp-add.ll
+++ b/llvm/test/Transforms/InstCombine/icmp-add.ll
@@ -587,3 +587,38 @@ define i1 @sum_nuw_commute(i32 %x, i32 %y) {
%c = icmp ugt i32 %x, %rhs
ret i1 %c
}
+
+; PR2698 - https://bugs.llvm.org/show_bug.cgi?id=2698
+
+declare void @use1(i1)
+declare void @use8(i8)
+
+define void @bzip1(i8 %a, i8 %b, i8 %x) {
+; CHECK-LABEL: @bzip1(
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT: call void @use1(i1 [[CMP]])
+; CHECK-NEXT: ret void
+;
+ %add1 = add i8 %a, %x
+ %add2 = add i8 %b, %x
+ %cmp = icmp eq i8 %add1, %add2
+ call void @use1(i1 %cmp)
+ ret void
+}
+
+define void @bzip2(i8 %a, i8 %b, i8 %x) {
+; CHECK-LABEL: @bzip2(
+; CHECK-NEXT: [[ADD1:%.*]] = add i8 [[A:%.*]], [[X:%.*]]
+; CHECK-NEXT: [[ADD2:%.*]] = add i8 [[B:%.*]], [[X]]
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[ADD1]], [[ADD2]]
+; CHECK-NEXT: call void @use1(i1 [[CMP]])
+; CHECK-NEXT: call void @use8(i8 [[ADD1]])
+; CHECK-NEXT: ret void
+;
+ %add1 = add i8 %a, %x
+ %add2 = add i8 %b, %x
+ %cmp = icmp eq i8 %add1, %add2
+ call void @use1(i1 %cmp)
+ call void @use8(i8 %add1)
+ ret void
+}
OpenPOWER on IntegriCloud