[llvm] [SandboxVec][DAG] MemDGNode for memory-dependency candidate nodes (PR #109684)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 1 10:43:11 PDT 2024
================
@@ -77,10 +136,20 @@ class DependencyGraph {
auto It = InstrToNodeMap.find(I);
return It != InstrToNodeMap.end() ? It->second.get() : nullptr;
}
+ /// Like getNode() but returns nullptr if \p I is nullptr.
+ DGNode *getNodeOrNull(Instruction *I) const {
+ if (I == nullptr)
+ return nullptr;
+ return getNode(I);
+ }
DGNode *getOrCreateNode(Instruction *I) {
auto [It, NotInMap] = InstrToNodeMap.try_emplace(I);
- if (NotInMap)
- It->second = std::make_unique<DGNode>(I);
+ if (NotInMap) {
+ if (I->isMemDepCandidate() || I->isStackSaveOrRestoreIntrinsic())
----------------
vporpo wrote:
Yes, I should have used the static function for the check.
https://github.com/llvm/llvm-project/pull/109684
More information about the llvm-commits
mailing list