blob: 3ceeeb658d1410439b0d431710feda7b9d3a6443 [file] [log] [blame]
Andrew Trick37eb38d2011-07-21 00:40:04 +00001; RUN: opt < %s -loop-reduce -S | FileCheck %s
2;
3; Test LSR's OptimizeShadowIV. Handle a floating-point IV with a
4; nonzero initial value.
5; rdar://9786536
6
7; First, make sure LSR doesn't crash on an empty IVUsers list.
8; CHECK: @dummyIV
9; CHECK-NOT: phi
10; CHECK-NOT: sitofp
11; CHECK: br
12define void @dummyIV() nounwind {
13entry:
14 br label %loop
15
16loop:
17 %i.01 = phi i32 [ -39, %entry ], [ %inc, %loop ]
18 %conv7 = sitofp i32 %i.01 to double
19 %inc = add nsw i32 %i.01, 1
20 br i1 undef, label %loop, label %for.end
21
22for.end:
23 unreachable
24}