1 ; RUN: opt < %s -loop-reduce -S | FileCheck %s
3 ; Test LSR's OptimizeShadowIV. Handle a floating-point IV with a
4 ; nonzero initial value.
7 ; First, make sure LSR doesn't crash on an empty IVUsers list.
12 define void @dummyIV() nounwind {
17 %i.01 = phi i32 [ -39, %entry ], [ %inc, %loop ]
18 %conv = sitofp i32 %i.01 to double
19 %inc = add nsw i32 %i.01, 1
20 br i1 undef, label %loop, label %for.end
26 ; Now check that the computed double constant is correct.
28 ; CHECK: phi double [ 0x43F0000000000000, %entry ]
30 define void @doubleIV() nounwind {
35 %i.01 = phi i32 [ -39, %entry ], [ %inc, %loop ]
36 %conv = sitofp i32 %i.01 to double
37 %div = fdiv double %conv, 4.000000e+01
38 %inc = add nsw i32 %i.01, 1
39 br i1 undef, label %loop, label %for.end