[InstCombine] minimize test case and use FileCheck

llvm-svn: 271805
This commit is contained in:
Sanjay Patel 2016-06-04 21:04:59 +00:00
parent 4c204230fc
commit 58a92a327d
1 changed files with 11 additions and 25 deletions

View File

@ -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
}