[llvm] [SandboxVec][DAG] Build actual dependencies (PR #111094)

Sriraman Tallam via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 8 14:37:42 PDT 2024


================
@@ -50,29 +51,137 @@ MemDGNodeIntervalBuilder::make(const Interval<Instruction> &Instrs,
                              cast<MemDGNode>(DAG.getNode(MemBotI)));
 }
 
+DependencyGraph::DependencyType
+DependencyGraph::getRoughDepType(Instruction *FromI, Instruction *ToI) {
+  if (FromI->mayWriteToMemory()) {
+    if (ToI->mayReadFromMemory())
+      return DependencyType::RAW;
+    if (ToI->mayWriteToMemory())
+      return DependencyType::WAW;
+  }
+  if (FromI->mayReadFromMemory()) {
+    if (ToI->mayWriteToMemory())
+      return DependencyType::WAR;
+    if (ToI->mayReadFromMemory())
+      return DependencyType::RAR;
+  }
----------------
tmsri wrote:

This is fine, a comment that the order matters in the  second case would resolve it.

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


More information about the llvm-commits mailing list