summaryrefslogtreecommitdiff
path: root/test/Transforms/SCCP/calltest.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-04-13 19:43:33 +0000
committerChris Lattner <sabre@nondot.org>2004-04-13 19:43:33 +0000
commit3d78b23d24f25b769facecc889f4b4a31bf93907 (patch)
treef83c74ba1cdafc463e01d739efc0eb800af747df /test/Transforms/SCCP/calltest.ll
parent25b8390bf23ed35640664d244951d684c5a7b132 (diff)
downloadllvm-3d78b23d24f25b769facecc889f4b4a31bf93907.tar.gz
llvm-3d78b23d24f25b769facecc889f4b4a31bf93907.tar.bz2
llvm-3d78b23d24f25b769facecc889f4b4a31bf93907.tar.xz
New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SCCP/calltest.ll')
-rw-r--r--test/Transforms/SCCP/calltest.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/Transforms/SCCP/calltest.ll b/test/Transforms/SCCP/calltest.ll
new file mode 100644
index 0000000000..e88914d8dc
--- /dev/null
+++ b/test/Transforms/SCCP/calltest.ll
@@ -0,0 +1,24 @@
+; RUN: llvm-as < %s | opt -sccp -adce -simplifycfg | llvm-dis | 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
+}