blob: e88914d8dc8f6dc021a02a6ec1a4e41fb465ab7b [file] [log] [blame]
Chris Lattner3d78b232004-04-13 19:43:33 +00001; RUN: llvm-as < %s | opt -sccp -adce -simplifycfg | llvm-dis | not grep br
2
3; No matter how hard you try, sqrt(1.0) is always 1.0. This allows the
4; optimizer to delete this loop.
5
6declare double %sqrt(double)
7
8double %test(uint %param) {
9entry:
10 br label %Loop
11
12Loop:
13 %I2 = phi uint [ 0, %entry ], [ %I3, %Loop ]
14 %V = phi double [ 1.0, %entry], [ %V2, %Loop ]
15
16 %V2 = call double %sqrt(double %V)
17
18 %I3 = add uint %I2, 1
19 %tmp.7 = setne uint %I3, %param
20 br bool %tmp.7, label %Loop, label %Exit
21
22Exit:
23 ret double %V
24}