summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
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
commit6749c24f408a3e1e1209c01ac9655eb5b302bd29 (patch)
tree2b9910b42065690fb331e47b22ce1b5aa1eb762b /llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
parentf15a53bc81377aa0c5e3864fd9cb41fa667a011d (diff)
downloadbcm5719-llvm-6749c24f408a3e1e1209c01ac9655eb5b302bd29.tar.gz
bcm5719-llvm-6749c24f408a3e1e1209c01ac9655eb5b302bd29.zip
[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 llvm-svn: 345818
Diffstat (limited to 'llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp')
-rw-r--r--llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
index 18333bfcc11..e7052e2e469 100644
--- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
@@ -749,7 +749,9 @@ int SystemZTTIImpl::getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
assert (!Dst->isVectorTy());
if (Opcode == Instruction::SIToFP || Opcode == Instruction::UIToFP)
- return (SrcScalarBits >= 32 ? 1 : 2 /*i8/i16 extend*/);
+ return (SrcScalarBits >= 32
+ ? 1
+ : SrcScalarBits > 1 ? 2 /*i8/i16 extend*/ : 5 /*branch seq.*/);
if ((Opcode == Instruction::ZExt || Opcode == Instruction::SExt) &&
Src->isIntegerTy(1)) {
OpenPOWER on IntegriCloud