mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 23:23:38 -04:00
[SystemZ] TargetTransformInfo cost functions implemented.
getArithmeticInstrCost(), getShuffleCost(), getCastInstrCost(), getCmpSelInstrCost(), getVectorInstrCost(), getMemoryOpCost(), getInterleavedMemoryOpCost() implemented. Interleaved access vectorization enabled. BasicTTIImpl::getCastInstrCost() improved to check for legal extending loads, in which case the cost of the z/sext instruction becomes 0. Review: Ulrich Weigand, Renato Golin. https://reviews.llvm.org/D29631 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300052 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -447,25 +447,25 @@ unsigned CostModelAnalysis::getInstructionCost(const Instruction *I) const {
|
||||
case Instruction::Select: {
|
||||
const SelectInst *SI = cast<SelectInst>(I);
|
||||
Type *CondTy = SI->getCondition()->getType();
|
||||
return TTI->getCmpSelInstrCost(I->getOpcode(), I->getType(), CondTy);
|
||||
return TTI->getCmpSelInstrCost(I->getOpcode(), I->getType(), CondTy, I);
|
||||
}
|
||||
case Instruction::ICmp:
|
||||
case Instruction::FCmp: {
|
||||
Type *ValTy = I->getOperand(0)->getType();
|
||||
return TTI->getCmpSelInstrCost(I->getOpcode(), ValTy);
|
||||
return TTI->getCmpSelInstrCost(I->getOpcode(), ValTy, I->getType(), I);
|
||||
}
|
||||
case Instruction::Store: {
|
||||
const StoreInst *SI = cast<StoreInst>(I);
|
||||
Type *ValTy = SI->getValueOperand()->getType();
|
||||
return TTI->getMemoryOpCost(I->getOpcode(), ValTy,
|
||||
SI->getAlignment(),
|
||||
SI->getPointerAddressSpace());
|
||||
SI->getAlignment(),
|
||||
SI->getPointerAddressSpace(), I);
|
||||
}
|
||||
case Instruction::Load: {
|
||||
const LoadInst *LI = cast<LoadInst>(I);
|
||||
return TTI->getMemoryOpCost(I->getOpcode(), I->getType(),
|
||||
LI->getAlignment(),
|
||||
LI->getPointerAddressSpace());
|
||||
LI->getAlignment(),
|
||||
LI->getPointerAddressSpace(), I);
|
||||
}
|
||||
case Instruction::ZExt:
|
||||
case Instruction::SExt:
|
||||
@@ -481,7 +481,7 @@ unsigned CostModelAnalysis::getInstructionCost(const Instruction *I) const {
|
||||
case Instruction::BitCast:
|
||||
case Instruction::AddrSpaceCast: {
|
||||
Type *SrcTy = I->getOperand(0)->getType();
|
||||
return TTI->getCastInstrCost(I->getOpcode(), I->getType(), SrcTy);
|
||||
return TTI->getCastInstrCost(I->getOpcode(), I->getType(), SrcTy, I);
|
||||
}
|
||||
case Instruction::ExtractElement: {
|
||||
const ExtractElementInst * EEI = cast<ExtractElementInst>(I);
|
||||
|
||||
Reference in New Issue
Block a user