[llvm] [SLP]Fix graph traversal in getSpillCost (PR #124984)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 30 11:45:18 PST 2025
================
@@ -12252,25 +12254,47 @@ InstructionCost BoUpSLP::getSpillCost() const {
};
// Debug information does not impact spill cost.
- if (isa<CallBase>(&*PrevInstIt) && !NoCallIntrinsic(&*PrevInstIt) &&
- &*PrevInstIt != PrevInst)
+ // Vectorized calls, represented as vector intrinsics, do not impact spill
+ // cost.
+ if (const auto *CB = dyn_cast<CallBase>(&*PrevInstIt);
+ CB && !NoCallIntrinsic(CB) &&
+ (!isVectorized(CB) ||
+ any_of(getTreeEntries(CB), [&](const TreeEntry *TE) {
----------------
preames wrote:
Can you move this bit to a new review? I agree we should explore in this direction, but these needs to happen once per tree entry, not once per instruction corresponding to that tree entry. I'd also like to get your previous change - with just the isVectorized change - landed so that we can iterate on top of that.
https://github.com/llvm/llvm-project/pull/124984
More information about the llvm-commits
mailing list