[llvm] [AMDGPU][VOPD] Limit VOPDPairing from reaching over load dependencies (PR #201930)
Joe Nash via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 12 09:08:26 PDT 2026
================
@@ -264,6 +264,31 @@ static bool shouldScheduleVOPDAdjacent(const TargetInstrInfo &TII,
.has_value();
}
+/// Collect all load (dependents if \p Forward else dependencies) that connect
+/// to \p SU.
+static void collectLoads(SmallVector<SUnit *> &Loads, BitVector &Visited,
+ const SUnit &SU, bool Forward) {
+ if (SU.isBoundaryNode() || Visited.test(SU.NodeNum))
+ return;
+
+ const SmallVector<SDep, 4> &Deps = Forward ? SU.Succs : SU.Preds;
+ for (const SDep &Edge : Deps) {
+ if (Edge.getKind() != SDep::Data)
+ continue;
+ SUnit *Dep = Edge.getSUnit();
+ if (Dep->isBoundaryNode())
+ continue;
+
+ if (Dep->isInstr() && Dep->getInstr()->mayLoad()) {
+ Loads.push_back(Dep);
----------------
Sisyph wrote:
I think this should have a Visited.test() guard. We could end up pushing duplicate Loads
https://github.com/llvm/llvm-project/pull/201930
More information about the llvm-commits
mailing list