diff options
author | Jonas Paulsson <paulsson@linux.vnet.ibm.com> | 2018-11-01 09:01:51 +0000 |
---|---|---|
committer | Jonas Paulsson <paulsson@linux.vnet.ibm.com> | 2018-11-01 09:01:51 +0000 |
commit | b7d7362e652b868e42032b8bee5e853e5f90dfe1 (patch) | |
tree | 6471d3bd315c44b781fa4ce0191b7ebda402ae96 /test/Analysis | |
parent | 2f425e9c7946b9d74e64ebbfa33c1caa36914402 (diff) |
[SystemZ::TTI] Accurate costs for i1->double vector conversions
This factors out a new method getBoolVecToIntConversionCost() containing the
code for vector sext/zext of i1, in order to reuse it for i1 to double vector
conversions.
Review: Ulrich Weigand
https://reviews.llvm.org/D53923
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r-- | test/Analysis/CostModel/SystemZ/cmp-tofp.ll | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/Analysis/CostModel/SystemZ/cmp-tofp.ll b/test/Analysis/CostModel/SystemZ/cmp-tofp.ll new file mode 100644 index 00000000000..f50e3ea23cf --- /dev/null +++ b/test/Analysis/CostModel/SystemZ/cmp-tofp.ll @@ -0,0 +1,43 @@ +; RUN: opt < %s -cost-model -analyze -mtriple=systemz-unknown -mcpu=z13 | FileCheck %s +; +; Costs for conversion of i1 vectors to vectors of double. + +define <2 x double> @fun0(<2 x i8> %val1, <2 x i8> %val2) { + %cmp = icmp eq <2 x i8> %val1, %val2 + %v = uitofp <2 x i1> %cmp to <2 x double> + ret <2 x double> %v + +; CHECK: fun0 +; CHECK: cost of 1 for instruction: %cmp = icmp eq <2 x i8> %val1, %val2 +; CHECK: cost of 5 for instruction: %v = uitofp <2 x i1> %cmp to <2 x double> +} + +define <2 x double> @fun1(<2 x i8> %val1, <2 x i8> %val2) { + %cmp = icmp eq <2 x i8> %val1, %val2 + %v = sitofp <2 x i1> %cmp to <2 x double> + ret <2 x double> %v + +; CHECK: fun1 +; CHECK: cost of 1 for instruction: %cmp = icmp eq <2 x i8> %val1, %val2 +; CHECK: cost of 4 for instruction: %v = sitofp <2 x i1> %cmp to <2 x double> +} + +define <2 x double> @fun2(<2 x i64> %val1, <2 x i64> %val2) { + %cmp = icmp eq <2 x i64> %val1, %val2 + %v = uitofp <2 x i1> %cmp to <2 x double> + ret <2 x double> %v + +; CHECK: fun2 +; CHECK: cost of 1 for instruction: %cmp = icmp eq <2 x i64> %val1, %val2 +; CHECK: cost of 2 for instruction: %v = uitofp <2 x i1> %cmp to <2 x double> +} + +define <2 x double> @fun3(<2 x i64> %val1, <2 x i64> %val2) { + %cmp = icmp eq <2 x i64> %val1, %val2 + %v = sitofp <2 x i1> %cmp to <2 x double> + ret <2 x double> %v + +; CHECK: fun3 +; CHECK: cost of 1 for instruction: %cmp = icmp eq <2 x i64> %val1, %val2 +; CHECK: cost of 1 for instruction: %v = sitofp <2 x i1> %cmp to <2 x double> +} |