summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/select.ll
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2012-07-09 20:31:12 +0000
committerOwen Anderson <resistor@mac.com>2012-07-09 20:31:12 +0000
commitd4b841f8f9992f06eb8bd39145bc305a5e84e159 (patch)
tree34a71af37c2b0229d5d390a724482ead7fab766e /llvm/test/CodeGen/ARM/select.ll
parent05d0d447c4dfd96d8f094047b282e21a10d71138 (diff)
downloadbcm5719-llvm-d4b841f8f9992f06eb8bd39145bc305a5e84e159.tar.gz
bcm5719-llvm-d4b841f8f9992f06eb8bd39145bc305a5e84e159.zip
Teach the DAG combiner to turn sitofp/uitofp from i1 into a conditional move, since there are only two possible values.
Previously, this would become an integer extension operation, followed by a real integer->float conversion. llvm-svn: 159957
Diffstat (limited to 'llvm/test/CodeGen/ARM/select.ll')
-rw-r--r--llvm/test/CodeGen/ARM/select.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/select.ll b/llvm/test/CodeGen/ARM/select.ll
index 3e07da841a5..418d4f31ee2 100644
--- a/llvm/test/CodeGen/ARM/select.ll
+++ b/llvm/test/CodeGen/ARM/select.ll
@@ -113,3 +113,29 @@ entry:
call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, [2 x i32], i32, float)*)(i8* undef, i8* undef, [2 x i32] %tmp493, i32 0, float 1.000000e+00) optsize
ret void
}
+
+; CHECK: f10
+define float @f10(i32 %a, i32 %b) nounwind uwtable readnone ssp {
+; CHECK-NOT: floatsisf
+ %1 = icmp eq i32 %a, %b
+ %2 = zext i1 %1 to i32
+ %3 = sitofp i32 %2 to float
+ ret float %3
+}
+
+; CHECK: f11
+define float @f11(i32 %a, i32 %b) nounwind uwtable readnone ssp {
+; CHECK-NOT: floatsisf
+ %1 = icmp eq i32 %a, %b
+ %2 = sitofp i1 %1 to float
+ ret float %2
+}
+
+; CHECK: f12
+define float @f12(i32 %a, i32 %b) nounwind uwtable readnone ssp {
+; CHECK-NOT: floatunsisf
+ %1 = icmp eq i32 %a, %b
+ %2 = uitofp i1 %1 to float
+ ret float %2
+}
+
OpenPOWER on IntegriCloud