[llvm] [SandboxVec][DAG] MemDGNode for memory-dependency candidate nodes (PR #109684)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 10:47:59 PDT 2024


================
@@ -31,6 +31,25 @@ void DGNode::dump() const {
 }
 #endif // NDEBUG
 
+Interval<MemDGNode>
+MemDGNodeIntervalBuilder::make(const Interval<Instruction> &Instrs,
+                               DependencyGraph &DAG) {
+  // If top or bottom instructions are not mem-dep candidate nodes we need to
+  // walk down/up the chain and find the mem-dep ones.
+  Instruction *MemTopI = Instrs.top();
+  Instruction *MemBotI = Instrs.bottom();
+  while (!DGNode::isMemDepCandidate(MemTopI) && MemTopI != MemBotI)
+    MemTopI = MemTopI->getNextNode();
----------------
vporpo wrote:

We just skip the non memory-candidate instructions. getNextNode() gives you the next instruction in the instruction list.

https://github.com/llvm/llvm-project/pull/109684


More information about the llvm-commits mailing list