[llvm] [VectorCombine][AMDGPU] Shrink demanded vector loads (PR #202501)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 9 02:05:49 PDT 2026
================
@@ -1779,6 +1779,14 @@ class TargetTransformInfo {
getMemIntrinsicInstrCost(const MemIntrinsicCostAttributes &MICA,
TTI::TargetCostKind CostKind) const;
+ /// Return true if replacing \p Load with the narrower load plan is profitable.
+ /// \p NewLoadTys and \p NewLoadOffsets are parallel arrays; offsets are bytes
+ /// from \p Load's pointer operand. Targets should evaluate the plan as a whole.
+ LLVM_ABI bool
+ shouldReduceLoadWidth(LoadInst *Load, ArrayRef<Type *> NewLoadTys,
----------------
arsenm wrote:
I also don't like the naming. This is up-porting the TargetLowering function, while not leaning on the implementation or having the exact same meaning.
Can't you infer the same cost from getMemoryOpCost as-is? IIRC AMDGPU is missing a proper implementation of it
https://github.com/llvm/llvm-project/pull/202501
More information about the llvm-commits
mailing list