Home | History | Annotate | Download | only in InstCombine
      1 ; RUN: opt < %s -instcombine -S > %t
      2 ; RUN: not grep zext %t
      3 ; RUN: not grep slt %t
      4 ; RUN: grep {icmp ult} %t
      5 
      6 ; Instcombine should convert the zext+slt into a simple ult.
      7 
      8 define void @foo(double* %p) nounwind {
      9 entry:
     10 	br label %bb
     11 
     12 bb:
     13 	%indvar = phi i64 [ 0, %entry ], [ %indvar.next, %bb ]
     14 	%t0 = and i64 %indvar, 65535
     15 	%t1 = getelementptr double* %p, i64 %t0
     16 	%t2 = load double* %t1, align 8
     17 	%t3 = fmul double %t2, 2.2
     18 	store double %t3, double* %t1, align 8
     19 	%i.04 = trunc i64 %indvar to i16
     20 	%t4 = add i16 %i.04, 1
     21 	%t5 = zext i16 %t4 to i32
     22 	%t6 = icmp slt i32 %t5, 500
     23 	%indvar.next = add i64 %indvar, 1
     24 	br i1 %t6, label %bb, label %return
     25 
     26 return:
     27 	ret void
     28 }
     29