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

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 27 09:56:22 PDT 2024


================
@@ -66,9 +84,94 @@ class DGNode {
 #endif // NDEBUG
 };
 
+/// A DependencyGraph Node for instructiosn that may read/write memory, or have
+/// some ordering constraints, like with stacksave/stackrestore and
+/// alloca/inalloca.
+class MemDGNode final : public DGNode {
+  MemDGNode *PrevMemN = nullptr;
+  MemDGNode *NextMemN = nullptr;
+
+  void setNextNode(DGNode *N) { NextMemN = cast_or_null<MemDGNode>(N); }
+  void setPrevNode(DGNode *N) { PrevMemN = cast_or_null<MemDGNode>(N); }
----------------
Sterling-Augustine wrote:

I think "cast_if_present" is the new hotness over cast_or_null.

How sure are we that these will always be MemDGNodes? And if we _are_ sure, shouldn't it take MemDGNodes then?

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


More information about the llvm-commits mailing list