[llvm] 041e5c9 - [X86] getMemoryOpCost - ensure we pass through OpInfo / Instruction args to base getMemoryOpCost calls
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 4 03:44:14 PST 2024
Author: Simon Pilgrim
Date: 2024-12-04T11:43:52Z
New Revision: 041e5c96c4bd247a3dd6099f49143ee66d9205d8
URL: https://github.com/llvm/llvm-project/commit/041e5c96c4bd247a3dd6099f49143ee66d9205d8
DIFF: https://github.com/llvm/llvm-project/commit/041e5c96c4bd247a3dd6099f49143ee66d9205d8.diff
LOG: [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
Added:
Modified:
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index dee48de37a0aee..3b424bbb53e5b1 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -5147,7 +5147,7 @@ InstructionCost X86TTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
// Type legalization can't handle structs
if (TLI->getValueType(DL, Src, true) == MVT::Other)
return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
- CostKind);
+ CostKind, OpInfo, I);
// Legalize the type.
std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(Src);
@@ -5159,7 +5159,7 @@ InstructionCost X86TTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
// Add a cost for constant load to vector.
if (Opcode == Instruction::Store && OpInfo.isConstant())
Cost += getMemoryOpCost(Instruction::Load, Src, DL.getABITypeAlign(Src),
- /*AddressSpace=*/0, CostKind);
+ /*AddressSpace=*/0, CostKind, OpInfo);
// Handle the simple case of non-vectors.
// NOTE: this assumes that legalization never creates vector from scalars!
@@ -5189,7 +5189,7 @@ InstructionCost X86TTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
if (XMMBits % EltTyBits != 0)
// Vector size must be a multiple of the element size. I.e. no padding.
return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
- CostKind);
+ CostKind, OpInfo, I);
const int NumEltPerXMM = XMMBits / EltTyBits;
auto *XMMVecTy = FixedVectorType::get(EltTy, NumEltPerXMM);
@@ -5200,7 +5200,7 @@ InstructionCost X86TTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
if ((8 * CurrOpSizeBytes) % EltTyBits != 0)
// Vector size must be a multiple of the element size. I.e. no padding.
return BaseT::getMemoryOpCost(Opcode, Src, Alignment, AddressSpace,
- CostKind);
+ CostKind, OpInfo, I);
int CurrNumEltPerOp = (8 * CurrOpSizeBytes) / EltTyBits;
assert(CurrOpSizeBytes > 0 && CurrNumEltPerOp > 0 && "How'd we get here?");
More information about the llvm-commits
mailing list