[llvm] r372004 - [InstCombine] move tests for icmp+add; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 08:33:40 PDT 2019


Author: spatel
Date: Mon Sep 16 08:33:40 2019
New Revision: 372004

URL: http://llvm.org/viewvc/llvm-project?rev=372004&view=rev
Log:
[InstCombine] move tests for icmp+add; NFC

Removed:
    llvm/trunk/test/Transforms/InstCombine/2009-01-31-Pressure.ll
Modified:
    llvm/trunk/test/Transforms/InstCombine/icmp-add.ll

Removed: llvm/trunk/test/Transforms/InstCombine/2009-01-31-Pressure.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2009-01-31-Pressure.ll?rev=372003&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/2009-01-31-Pressure.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/2009-01-31-Pressure.ll (removed)
@@ -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
-}

Modified: llvm/trunk/test/Transforms/InstCombine/icmp-add.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/icmp-add.ll?rev=372004&r1=372003&r2=372004&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/icmp-add.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/icmp-add.ll Mon Sep 16 08:33:40 2019
@@ -587,3 +587,38 @@ define i1 @sum_nuw_commute(i32 %x, i32 %
   %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
+}




More information about the llvm-commits mailing list