blob: 2e46b691832295ad02fc215c7d5ce6acd68b2b16 [file] [log] [blame]
Reid Spencer69ccadd2006-12-02 04:23:10 +00001; RUN: llvm-upgrade < %s | llvm-as | opt -sccp -adce -simplifycfg | llvm-dis | not grep br
Chris Lattner3d78b232004-04-13 19:43:33 +00002
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}