aboutsummaryrefslogtreecommitdiff
path: root/llvm/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
commit020be9dc29070407c483e15f65aa2e8624a2beec (patch)
tree35609c132a59808c1889738b3ee1a6fedd4c9013 /llvm/lib/Target/TargetTransformImpl.cpp
parenta714efc1bd14b37db33677844572ebb40ab3ace2 (diff)
downloadllvm-020be9dc29070407c483e15f65aa2e8624a2beec.zip
llvm-020be9dc29070407c483e15f65aa2e8624a2beec.tar.gz
llvm-020be9dc29070407c483e15f65aa2e8624a2beec.tar.bz2
Cost Model: teach the cost model about expanding integers.
llvm-svn: 167401
Diffstat (limited to 'llvm/lib/Target/TargetTransformImpl.cpp')
-rw-r--r--llvm/lib/Target/TargetTransformImpl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/TargetTransformImpl.cpp b/llvm/lib/Target/TargetTransformImpl.cpp
index a9f02ed..4b427a2 100644
--- a/llvm/lib/Target/TargetTransformImpl.cpp
+++ b/llvm/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;
}