summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/add-sitofp.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-05-23 02:28:01 +0000
committerDan Gohman <gohman@apple.com>2008-05-23 02:28:01 +0000
commita332f17c8c80bb457617052fb35a3f2cecd05493 (patch)
tree78f7513fd2bc8bde2d204017f225ef551dea752b /test/Transforms/InstCombine/add-sitofp.ll
parente4977cf750eaff28275429191821420c20b0c64f (diff)
downloadllvm-a332f17c8c80bb457617052fb35a3f2cecd05493.tar.gz
llvm-a332f17c8c80bb457617052fb35a3f2cecd05493.tar.bz2
llvm-a332f17c8c80bb457617052fb35a3f2cecd05493.tar.xz
Generalize the new code in instcombine's ComputeNumSignBits for handling
and/or to handle more cases (such as this add-sitofp.ll testcase), and port it to selectiondag's ComputeNumSignBits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/add-sitofp.ll')
-rw-r--r--test/Transforms/InstCombine/add-sitofp.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/add-sitofp.ll b/test/Transforms/InstCombine/add-sitofp.ll
new file mode 100644
index 0000000000..35c6567da6
--- /dev/null
+++ b/test/Transforms/InstCombine/add-sitofp.ll
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {add i32}
+
+define double @x(i32 %a, i32 %b) nounwind {
+ %m = lshr i32 %a, 24
+ %n = and i32 %m, %b
+ %o = sitofp i32 %n to double
+ %p = add double %o, 1.0
+ ret double %p
+}