1 ; RUN: opt < %s -analyze -scalar-evolution -disable-output | grep { --> {.*,+,.*}<bb>} | count 8
3 ; The addrecs in this loop are analyzable only by using nsw information.
5 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64"
7 define void @foo(double* %p) nounwind {
9 %tmp = load double* %p, align 8 ; <double> [#uses=1]
10 %tmp1 = fcmp ogt double %tmp, 2.000000e+00 ; <i1> [#uses=1]
11 br i1 %tmp1, label %bb.nph, label %return
13 bb.nph: ; preds = %entry
16 bb: ; preds = %bb1, %bb.nph
17 %i.01 = phi i32 [ %tmp8, %bb1 ], [ 0, %bb.nph ] ; <i32> [#uses=3]
18 %tmp2 = sext i32 %i.01 to i64 ; <i64> [#uses=1]
19 %tmp3 = getelementptr double* %p, i64 %tmp2 ; <double*> [#uses=1]
20 %tmp4 = load double* %tmp3, align 8 ; <double> [#uses=1]
21 %tmp5 = fmul double %tmp4, 9.200000e+00 ; <double> [#uses=1]
22 %tmp6 = sext i32 %i.01 to i64 ; <i64> [#uses=1]
23 %tmp7 = getelementptr double* %p, i64 %tmp6 ; <double*> [#uses=1]
24 store double %tmp5, double* %tmp7, align 8
25 %tmp8 = add nsw i32 %i.01, 1 ; <i32> [#uses=2]
29 %phitmp = sext i32 %tmp8 to i64 ; <i64> [#uses=1]
30 %tmp9 = getelementptr double* %p, i64 %phitmp ; <double*> [#uses=1]
31 %tmp10 = load double* %tmp9, align 8 ; <double> [#uses=1]
32 %tmp11 = fcmp ogt double %tmp10, 2.000000e+00 ; <i1> [#uses=1]
33 br i1 %tmp11, label %bb, label %bb1.return_crit_edge
35 bb1.return_crit_edge: ; preds = %bb1
38 return: ; preds = %bb1.return_crit_edge, %entry