summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetTransformImpl.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2012-10-25 18:17:48 +0000
committerNadav Rotem <nrotem@apple.com>2012-10-25 18:17:48 +0000
commit8b749b236465243f34d981691413a099b0689433 (patch)
treeed9d63b6365bdaace6548a6893ebaa4cd56f93fe /llvm/lib/Target/TargetTransformImpl.cpp
parent369ea3cb7760dae4780b984a1a1d8e2dee051fbc (diff)
downloadbcm5719-llvm-8b749b236465243f34d981691413a099b0689433.tar.gz
bcm5719-llvm-8b749b236465243f34d981691413a099b0689433.zip
Minor cleanups.
llvm-svn: 166706
Diffstat (limited to 'llvm/lib/Target/TargetTransformImpl.cpp')
-rw-r--r--llvm/lib/Target/TargetTransformImpl.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Target/TargetTransformImpl.cpp b/llvm/lib/Target/TargetTransformImpl.cpp
index 382eecb7665..c8bd80ea256 100644
--- a/llvm/lib/Target/TargetTransformImpl.cpp
+++ b/llvm/lib/Target/TargetTransformImpl.cpp
@@ -123,7 +123,7 @@ int InstructionOpcodeToISD(unsigned Opcode) {
return OpToISDTbl[Opcode - 1];
}
-std::pair<unsigned, EVT>
+std::pair<unsigned, EVT>
VectorTargetTransformImpl::getTypeLegalizationCost(LLVMContext &C,
EVT Ty) const {
unsigned Cost = 1;
@@ -150,17 +150,17 @@ VectorTargetTransformImpl::getInstrCost(unsigned Opcode, Type *Ty1,
// Check if any of the operands are vector operands.
int ISD = InstructionOpcodeToISD(Opcode);
+ // If we don't have any information about this instruction assume it costs 1.
+ if (ISD == 0)
+ return 1;
+
// Selects on vectors are actually vector selects.
if (ISD == ISD::SELECT) {
- assert(Ty2 && "Ty2 must hold the select type");
+ assert(Ty2 && "Ty2 must hold the condition type");
if (Ty2->isVectorTy())
ISD = ISD::VSELECT;
}
- // If we don't have any information about this instruction assume it costs 1.
- if (ISD == 0)
- return 1;
-
assert(Ty1 && "We need to have at least one type");
// From this stage we look at the legalized type.
@@ -174,7 +174,7 @@ VectorTargetTransformImpl::getInstrCost(unsigned Opcode, Type *Ty1,
}
unsigned NumElem =
- (LT.second.isVector() ? LT.second.getVectorNumElements() : 1);
+ (LT.second.isVector() ? LT.second.getVectorNumElements() : 1);
// We will probably scalarize this instruction. Assume that the cost is the
// number of the vector elements.
OpenPOWER on IntegriCloud