Skip to content

Commit 041e5c9

Browse files
committed
[X86] getMemoryOpCost - ensure we pass through OpInfo / Instruction args to base getMemoryOpCost calls
Nothing really uses these yet, but we shouldn't be losing the info. We can also pass on the OpInfo arg to the getMemoryOpCost constant load call to indicate if its constant/uniform/pow2 etc. Prep cleanup for #111126
1 parent 0adab6b commit 041e5c9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Target/X86/X86TargetTransformInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5147,7 +5147,7 @@ InstructionCost X86TTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
51475147
// Type legalization can't handle structs
51485148
if (TLI->getValueType(DL, Src, true) == MVT::Other)
51495149
return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
5150-
CostKind);
5150+
CostKind, OpInfo, I);
51515151

51525152
// Legalize the type.
51535153
std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(Src);
@@ -5159,7 +5159,7 @@ InstructionCost X86TTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
51595159
// Add a cost for constant load to vector.
51605160
if (Opcode == Instruction::Store && OpInfo.isConstant())
51615161
Cost += getMemoryOpCost(Instruction::Load, Src, DL.getABITypeAlign(Src),
5162-
/*AddressSpace=*/0, CostKind);
5162+
/*AddressSpace=*/0, CostKind, OpInfo);
51635163

51645164
// Handle the simple case of non-vectors.
51655165
// NOTE: this assumes that legalization never creates vector from scalars!
@@ -5189,7 +5189,7 @@ InstructionCost X86TTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
51895189
if (XMMBits % EltTyBits != 0)
51905190
// Vector size must be a multiple of the element size. I.e. no padding.
51915191
return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
5192-
CostKind);
5192+
CostKind, OpInfo, I);
51935193
const int NumEltPerXMM = XMMBits / EltTyBits;
51945194

51955195
auto *XMMVecTy = FixedVectorType::get(EltTy, NumEltPerXMM);
@@ -5200,7 +5200,7 @@ InstructionCost X86TTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
52005200
if ((8 * CurrOpSizeBytes) % EltTyBits != 0)
52015201
// Vector size must be a multiple of the element size. I.e. no padding.
52025202
return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
5203-
CostKind);
5203+
CostKind, OpInfo, I);
52045204
int CurrNumEltPerOp = (8 * CurrOpSizeBytes) / EltTyBits;
52055205

52065206
assert(CurrOpSizeBytes > 0 && CurrNumEltPerOp > 0 && "How'd we get here?");

0 commit comments

Comments
 (0)