summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-08-06 05:13:06 +0000
committerChris Lattner <sabre@nondot.org>2008-08-06 05:13:06 +0000
commit5af5f463e1b95e2af8d69591d07282427c2dc6a4 (patch)
tree88716c0b14c225f7e1537da7e37cfb4eba0b4b3d /test
parentb30591ec646b5f53c1163bf9bd74091248598589 (diff)
downloadllvm-5af5f463e1b95e2af8d69591d07282427c2dc6a4.tar.gz
llvm-5af5f463e1b95e2af8d69591d07282427c2dc6a4.tar.bz2
llvm-5af5f463e1b95e2af8d69591d07282427c2dc6a4.tar.xz
Zap sitofp/fptoui pairs. In all cases when the sign difference
matters, the result is undefined anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54396 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstCombine/sitofp.ll14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/Transforms/InstCombine/sitofp.ll b/test/Transforms/InstCombine/sitofp.ll
index 73dd23bc43..c26c351a74 100644
--- a/test/Transforms/InstCombine/sitofp.ll
+++ b/test/Transforms/InstCombine/sitofp.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sitofp
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep itofp
define i1 @test1(i8 %A) {
%B = sitofp i8 %A to double
@@ -41,3 +41,15 @@ define i32 @test6(i32 %A) {
ret i32 %G
}
+define i32 @test7(i32 %a) nounwind {
+ %b = sitofp i32 %a to double ; <double> [#uses=1]
+ %c = fptoui double %b to i32 ; <i32> [#uses=1]
+ ret i32 %c
+}
+
+define i32 @test8(i32 %a) nounwind {
+ %b = uitofp i32 %a to double ; <double> [#uses=1]
+ %c = fptosi double %b to i32 ; <i32> [#uses=1]
+ ret i32 %c
+}
+