aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis
diff options
context:
space:
mode:
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>2018-11-01 09:05:32 +0000
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>2018-11-01 09:05:32 +0000
commite46f5df5597cf319f406630da05da1146aa447e5 (patch)
tree1d29000633e37ef64726b68f09b666156c425a9a /test/Analysis
parentb7d7362e652b868e42032b8bee5e853e5f90dfe1 (diff)
[SystemZ::TTI] Recognize the higher cost of scalar i1 -> fp conversion
Scalar i1 to fp conversions are done with a branch sequence, so it should have a higher cost. Review: Ulrich Weigand https://reviews.llvm.org/D53924 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345818 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/CostModel/SystemZ/cmp-tofp-scalar.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Analysis/CostModel/SystemZ/cmp-tofp-scalar.ll b/test/Analysis/CostModel/SystemZ/cmp-tofp-scalar.ll
new file mode 100644
index 00000000000..6cd4ead76a5
--- /dev/null
+++ b/test/Analysis/CostModel/SystemZ/cmp-tofp-scalar.ll
@@ -0,0 +1,23 @@
+; RUN: opt < %s -cost-model -analyze -mtriple=systemz-unknown -mcpu=z13 | FileCheck %s
+;
+; Costs for conversion of i1 to fp.
+
+define float @fun0(i64 %val1, i64 %val2) {
+ %cmp = icmp eq i64 %val1, %val2
+ %v = uitofp i1 %cmp to float
+ ret float %v
+
+; CHECK: fun0
+; CHECK: cost of 1 for instruction: %cmp = icmp eq i64 %val1, %val2
+; CHECK: cost of 5 for instruction: %v = uitofp i1 %cmp to float
+}
+
+define double @fun1(i64 %val1, i64 %val2) {
+ %cmp = icmp eq i64 %val1, %val2
+ %v = uitofp i1 %cmp to double
+ ret double %v
+
+; CHECK: fun1
+; CHECK: cost of 1 for instruction: %cmp = icmp eq i64 %val1, %val2
+; CHECK: cost of 5 for instruction: %v = uitofp i1 %cmp to double
+}