summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-11-10 17:28:30 +0000
committerDuncan Sands <baldrick@free.fr>2008-11-10 17:28:30 +0000
commitd5b53e1c6c18e45dced09eed19b6cb89bf8c6548 (patch)
tree346bac38ca1b7e8d1e93807143ab7966f232fc38 /llvm/test
parentd36ed56c52775d4f7a2daf9af43188a192c9e4a9 (diff)
downloadbcm5719-llvm-d5b53e1c6c18e45dced09eed19b6cb89bf8c6548.tar.gz
bcm5719-llvm-d5b53e1c6c18e45dced09eed19b6cb89bf8c6548.zip
When promoting the result of fp_to_uint/fp_to_sint,
inform the optimizers that the result must be zero/ sign extended from the smaller type. For example, if a fp to unsigned i16 is promoted to fp to i32, then we are allowed to assume that the extra 16 bits are zero (because the result of fp to i16 is undefined if the result does not fit in an i16). This is quite aggressive, but should help the optimizers produce better code. This requires correcting a test which thought that fp_to_uint is some kind of truncation, which it is not: in the testcase (which does fp to i1), either the fp value converts to 0 or 1 or the result is undefined, which is quite different to truncation. llvm-svn: 58991
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/trunc-to-bool.ll11
1 files changed, 1 insertions, 10 deletions
diff --git a/llvm/test/CodeGen/X86/trunc-to-bool.ll b/llvm/test/CodeGen/X86/trunc-to-bool.ll
index 9dd14252ace..25a1191d8f1 100644
--- a/llvm/test/CodeGen/X86/trunc-to-bool.ll
+++ b/llvm/test/CodeGen/X86/trunc-to-bool.ll
@@ -2,7 +2,7 @@
; sure only the LSBit survives. Test that this is the case both for a returned
; value and as the operand of a branch.
; RUN: llvm-as < %s | llc -march=x86 | grep {\\(and\\)\\|\\(test.*\\\$1\\)} | \
-; RUN: count 6
+; RUN: count 5
define i1 @test1(i32 %X) zeroext {
%Y = trunc i32 %X to i1
@@ -40,15 +40,6 @@ cond_false:
ret i32 42
}
-define i32 @test5(float %f) {
- %tmp = fptoui float %f to i1
- br i1 %tmp, label %cond_true, label %cond_false
-cond_true:
- ret i32 21
-cond_false:
- ret i32 42
-}
-
define i32 @test6(double %d) {
%tmp = fptosi double %d to i1
br i1 %tmp, label %cond_true, label %cond_false
OpenPOWER on IntegriCloud