aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/TargetTransformImpl.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2012-11-05 21:11:10 +0000
committerNadav Rotem <nrotem@apple.com>2012-11-05 21:11:10 +0000
commit75138f58b0abaff54270481e879bc770df88114c (patch)
tree6087626bcd7bc842cc0cc8304e7741dbc2bb2508 /lib/Target/TargetTransformImpl.cpp
parent28989889bf3aa3314562d438aece245b71176ec4 (diff)
Cost Model: teach the cost model about expanding integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167401 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetTransformImpl.cpp')
-rw-r--r--lib/Target/TargetTransformImpl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Target/TargetTransformImpl.cpp b/lib/Target/TargetTransformImpl.cpp
index a9f02edaae..4b427a2b6d 100644
--- a/lib/Target/TargetTransformImpl.cpp
+++ b/lib/Target/TargetTransformImpl.cpp
@@ -143,7 +143,8 @@ VectorTargetTransformImpl::getTypeLegalizationCost(LLVMContext &C,
if (LK.first == TargetLowering::TypeLegal)
return std::make_pair(Cost, Ty.getSimpleVT());
- if (LK.first == TargetLowering::TypeSplitVector)
+ if (LK.first == TargetLowering::TypeSplitVector ||
+ LK.first == TargetLowering::TypeExpandInteger)
Cost *= 2;
// Keep legalizing the type.
@@ -300,7 +301,7 @@ unsigned VectorTargetTransformImpl::getCmpSelInstrCost(unsigned Opcode,
unsigned Cost = getCmpSelInstrCost(Opcode, ValTy->getScalarType(),
CondTy);
- // return the cost of multiple scalar invocation plus the cost of inserting
+ // Return the cost of multiple scalar invocation plus the cost of inserting
// and extracting the values.
return getScalarizationOverhead(ValTy, true, false) + Num * Cost;
}