Home | History | Annotate | Download | only in IndVarSimplify
      1 ; RUN: opt < %s -indvars -S | FileCheck %s
      2 ; RUN: opt < %s -indvars -disable-iv-rewrite -S | FileCheck %s
      3 ; CHECK-NOT: and
      4 ; CHECK-NOT: zext
      5 
      6 target datalayout = "-p:64:64:64-n:32:64"
      7 
      8 define void @foo(double* %d, i64 %n) nounwind {
      9 entry:
     10 	br label %loop
     11 
     12 loop:
     13 	%indvar = phi i64 [ 0, %entry ], [ %indvar.next, %loop ]
     14 	%indvar.i8 = and i64 %indvar, 255
     15 	%t0 = getelementptr double* %d, i64 %indvar.i8
     16 	%t1 = load double* %t0
     17 	%t2 = fmul double %t1, 0.1
     18 	store double %t2, double* %t0
     19 	%indvar.i24 = and i64 %indvar, 16777215
     20 	%t3 = getelementptr double* %d, i64 %indvar.i24
     21 	%t4 = load double* %t3
     22 	%t5 = fmul double %t4, 2.3
     23 	store double %t5, double* %t3
     24 	%t6 = getelementptr double* %d, i64 %indvar
     25 	%t7 = load double* %t6
     26 	%t8 = fmul double %t7, 4.5
     27 	store double %t8, double* %t6
     28 	%indvar.next = add i64 %indvar, 1
     29 	%exitcond = icmp eq i64 %indvar.next, 10
     30 	br i1 %exitcond, label %return, label %loop
     31 
     32 return:
     33 	ret void
     34 }
     35