Changeset View
Changeset View
Standalone View
Standalone View
lib/Analysis/CostModel.cpp
Show First 20 Lines • Show All 376 Lines • ▼ Show 20 Lines | static bool matchVectorSplittingReduction(const ExtractElementInst *ReduxRoot, | ||||
Ty = VecTy; | Ty = VecTy; | ||||
return true; | return true; | ||||
} | } | ||||
unsigned CostModelAnalysis::getInstructionCost(const Instruction *I) const { | unsigned CostModelAnalysis::getInstructionCost(const Instruction *I) const { | ||||
if (!TTI) | if (!TTI) | ||||
return -1; | return -1; | ||||
switch (I->getOpcode()) { | switch (I->getOpcode()) { | ||||
case Instruction::GetElementPtr:{ | case Instruction::GetElementPtr: | ||||
hfinkel: You don't need the { } here any longer. | |||||
Type *ValTy = I->getOperand(0)->getType()->getPointerElementType(); | return TTI->getUserCost(I); | ||||
return TTI->getAddressComputationCost(ValTy); | |||||
} | |||||
case Instruction::Ret: | case Instruction::Ret: | ||||
case Instruction::PHI: | case Instruction::PHI: | ||||
case Instruction::Br: { | case Instruction::Br: { | ||||
return TTI->getCFInstrCost(I->getOpcode()); | return TTI->getCFInstrCost(I->getOpcode()); | ||||
} | } | ||||
case Instruction::Add: | case Instruction::Add: | ||||
case Instruction::FAdd: | case Instruction::FAdd: | ||||
▲ Show 20 Lines • Show All 141 Lines • Show Last 20 Lines |
You don't need the { } here any longer.