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