File: calltest.ll

package info (click to toggle)
llvm 2.2-12
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 38,648 kB
  • ctags: 28,258
  • sloc: cpp: 215,479; sh: 12,132; ansic: 10,002; yacc: 5,525; perl: 2,352; ml: 1,580; makefile: 956; pascal: 718; lex: 602; exp: 320; ada: 193; lisp: 160; csh: 116; objc: 59; python: 59; tcl: 20
file content (25 lines) | stat: -rw-r--r-- 552 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
; RUN: llvm-upgrade < %s | llvm-as | opt -sccp -adce -simplifycfg | llvm-dis | \
; RUN:   not grep br

; No matter how hard you try, sqrt(1.0) is always 1.0.  This allows the
; optimizer to delete this loop.

declare double %sqrt(double)

double %test(uint %param) {
entry:
	br label %Loop

Loop:
	%I2 = phi uint [ 0, %entry ], [ %I3, %Loop ]
	%V  = phi double [ 1.0, %entry], [ %V2, %Loop ]

	%V2 = call double %sqrt(double %V)

	%I3 = add uint %I2, 1
	%tmp.7 = setne uint %I3, %param
	br bool %tmp.7, label %Loop, label %Exit

Exit:
	ret double %V
}