[llvm] [SLP] Bail out on store-to-load forwarding hazards (PR #199606)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 8 21:04:30 PDT 2026
================
@@ -680,6 +680,15 @@ class LLVM_ABI TargetTransformInfoImplBase {
}
virtual unsigned getCacheLineSize() const { return 0; }
+
+ virtual InstructionCost getStoreLoadForwardingConflictCost(
+ Type *VecTy, TargetTransformInfo::TargetCostKind CostKind) const {
+ // No subtarget scheduling model is available here, so fall back to a
+ // conservative default STLF stall penalty (~10 cycles). Targets with a real
+ // scheduling model go through BasicTTIImpl and use their own value instead.
+ constexpr unsigned DefaultStoreLoadForwardingConflictCost = 10;
+ return InstructionCost(DefaultStoreLoadForwardingConflictCost);
----------------
mbhade-amd wrote:
To dedupe, the default has to stay at the MC layer or lower (the sched model needs it and MC can't depend on the cost layer). Two options: (1) keep MCSchedModel::DefaultStoreLoadForwardingPenalty and reference it from the TTI fallback (re-adds the MCSchedule.h include — header-only, no link dep), or (2) move the constant to a shared lower-layer header both include. Which do you prefer?
https://github.com/llvm/llvm-project/pull/199606
More information about the llvm-commits
mailing list