[llvm] [MachinePipeliner] Introduce a new class for loop-carried deps (PR #137663)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 4 16:37:05 PDT 2025
================
@@ -941,28 +1014,116 @@ static bool hasLoopCarriedMemDep(const SUnitWithMemInfo &Src,
return false;
}
+void LoopCarriedOrderDepsTracker::LoadStoreChunk::append(SUnit *SU) {
+ const MachineInstr *MI = SU->getInstr();
+ if (!MI->mayLoadOrStore())
+ return;
+ (MI->mayStore() ? Stores : Loads).emplace_back(SU);
+}
+
+LoopCarriedOrderDepsTracker::LoopCarriedOrderDepsTracker(
+ SwingSchedulerDAG *SSD, BatchAAResults *BAA, const TargetInstrInfo *TII,
+ const TargetRegisterInfo *TRI)
+ : DAG(SSD), BAA(BAA), SUnits(DAG->SUnits), N(SUnits.size()),
+ LoopCarried(N, BitVector(N)), TII(TII), TRI(TRI) {}
+
+void LoopCarriedOrderDepsTracker::computeDependencies() {
+ // Traverse all instructions and extract only what we are targetting.
+ for (auto &SU : SUnits) {
+ auto Tagged = checkInstrType(&SU);
+
+ // This instruction has no loop-carried order-dependencies.
+ if (!Tagged)
+ continue;
+ TaggedSUnits.push_back(*Tagged);
+ }
+
+ computeDependenciesAux();
+
+ LLVM_DEBUG({
+ for (unsigned I = 0; I != N; I++)
+ assert(!LoopCarried[I].test(I) && "Unexpected self-loop");
+ });
----------------
aankit-ca wrote:
I think we can get rid of this
https://github.com/llvm/llvm-project/pull/137663
More information about the llvm-commits
mailing list