mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 00:17:01 +00:00
Improve the X86 cost model for loads and stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170830 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -17818,6 +17818,30 @@ X86VectorTargetTransformInfo::getArithmeticInstrCost(unsigned Opcode,
|
||||
return VectorTargetTransformImpl::getArithmeticInstrCost(Opcode, Ty);
|
||||
}
|
||||
|
||||
|
||||
unsigned
|
||||
X86VectorTargetTransformInfo::getMemoryOpCost(unsigned Opcode, Type *Src,
|
||||
unsigned Alignment,
|
||||
unsigned AddressSpace) const {
|
||||
// Legalize the type.
|
||||
std::pair<unsigned, MVT> LT = getTypeLegalizationCost(Src);
|
||||
assert(Opcode == Instruction::Load || Opcode == Instruction::Store &&
|
||||
"Invalid Opcode");
|
||||
|
||||
const X86Subtarget &ST =
|
||||
TLI->getTargetMachine().getSubtarget<X86Subtarget>();
|
||||
|
||||
// Each load/store unit costs 1.
|
||||
unsigned Cost = LT.first * 1;
|
||||
|
||||
// On Sandybridge 256bit load/stores are double pumped
|
||||
// (but not on Haswell).
|
||||
if (LT.second.getSizeInBits() > 128 && !ST.hasAVX2())
|
||||
Cost*=2;
|
||||
|
||||
return Cost;
|
||||
}
|
||||
|
||||
unsigned
|
||||
X86VectorTargetTransformInfo::getVectorInstrCost(unsigned Opcode, Type *Val,
|
||||
unsigned Index) const {
|
||||
|
||||
Reference in New Issue
Block a user