[llvm] r271805 - [InstCombine] minimize test case and use FileCheck
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 4 14:04:59 PDT 2016
Author: spatel
Date: Sat Jun 4 16:04:59 2016
New Revision: 271805
URL: http://llvm.org/viewvc/llvm-project?rev=271805&view=rev
Log:
[InstCombine] minimize test case and use FileCheck
Modified:
llvm/trunk/test/Transforms/InstCombine/signed-comparison.ll
Modified: llvm/trunk/test/Transforms/InstCombine/signed-comparison.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/signed-comparison.ll?rev=271805&r1=271804&r2=271805&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/signed-comparison.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/signed-comparison.ll Sat Jun 4 16:04:59 2016
@@ -1,28 +1,14 @@
-; RUN: opt < %s -instcombine -S > %t
-; RUN: not grep zext %t
-; RUN: not grep slt %t
-; RUN: grep "icmp ult" %t
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -instcombine -S | FileCheck %s
-; Instcombine should convert the zext+slt into a simple ult.
+; Convert the zext+slt into a simple ult.
-define void @foo(double* %p) nounwind {
-entry:
- br label %bb
-
-bb:
- %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %bb ]
- %t0 = and i64 %indvar, 65535
- %t1 = getelementptr double, double* %p, i64 %t0
- %t2 = load double, double* %t1, align 8
- %t3 = fmul double %t2, 2.2
- store double %t3, double* %t1, align 8
- %i.04 = trunc i64 %indvar to i16
- %t4 = add i16 %i.04, 1
- %t5 = zext i16 %t4 to i32
- %t6 = icmp slt i32 %t5, 500
- %indvar.next = add i64 %indvar, 1
- br i1 %t6, label %bb, label %return
-
-return:
- ret void
+define i1 @foo(i16 %t4) {
+; CHECK-LABEL: @foo(
+; CHECK-NEXT: [[T6:%.*]] = icmp ult i16 %t4, 500
+; CHECK-NEXT: ret i1 [[T6]]
+;
+ %t5 = zext i16 %t4 to i32
+ %t6 = icmp slt i32 %t5, 500
+ ret i1 %t6
}
More information about the llvm-commits
mailing list