Skip to content

Commit 82a9f13

Browse files
authored
Merge pull request #29316 from atrick/escape-verifysummary
EscapeAnalysis verification: fix false positives.
2 parents f1ef08a + 1654dd5 commit 82a9f13

File tree

6 files changed

+505
-131
lines changed

6 files changed

+505
-131
lines changed

include/swift/SILOptimizer/Analysis/EscapeAnalysis.h

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,6 @@ class EscapeAnalysis : public BottomUpIPAnalysis {
688688
CGNode *FromMergeTarget = From->getMergeTarget();
689689
CGNode *ToMergeTarget = To->getMergeTarget();
690690
if (FromMergeTarget != ToMergeTarget) {
691-
ToMergeTarget->mergeProperties(FromMergeTarget);
692691
FromMergeTarget->mergeTo = ToMergeTarget;
693692
ToMerge.push_back(FromMergeTarget);
694693
}
@@ -722,15 +721,12 @@ class EscapeAnalysis : public BottomUpIPAnalysis {
722721
}
723722
}
724723

725-
// Helper for getNode and getValueContent.
726-
CGNode *getOrCreateNode(ValueBase *V, PointerKind pointerKind);
727-
728724
/// Gets or creates a node for a value \p V.
729725
/// If V is a projection(-path) then the base of the projection(-path) is
730726
/// taken. This means the node is always created for the "outermost" value
731727
/// where V is contained.
732-
/// Returns null, if V is not a "pointer".
733-
CGNode *getNode(ValueBase *V, bool createIfNeeded = true);
728+
/// Returns null, if V (or its base value) is not a "pointer".
729+
CGNode *getNode(SILValue V);
734730

735731
// Helper for getValueContent to create and return a content node with the
736732
// given \p isInterior and \p hasReferenceOnly flags. \p addrNode
@@ -781,15 +777,6 @@ class EscapeAnalysis : public BottomUpIPAnalysis {
781777
return ReturnNode;
782778
}
783779

784-
/// Returns the node of the "exact" value \p V (no projections are skipped)
785-
/// if one exists.
786-
CGNode *lookupNode(ValueBase *V) {
787-
CGNode *Node = Values2Nodes.lookup(V);
788-
if (Node)
789-
return Node->getMergeTarget();
790-
return nullptr;
791-
}
792-
793780
/// Re-uses a node for another SIL value.
794781
void setNode(ValueBase *V, CGNode *Node) {
795782
assert(Values2Nodes.find(V) == Values2Nodes.end());
@@ -872,13 +859,6 @@ class EscapeAnalysis : public BottomUpIPAnalysis {
872859
bool forwardTraverseDefer(CGNode *startNode, CGNodeVisitor &&visitor);
873860

874861
public:
875-
/// Gets or creates a node for a value \p V.
876-
/// If V is a projection(-path) then the base of the projection(-path) is
877-
/// taken. This means the node is always created for the "outermost" value
878-
/// where V is contained.
879-
/// Returns null, if V is not a "pointer".
880-
CGNode *getNodeOrNull(ValueBase *V) { return getNode(V, false); }
881-
882862
/// Get the content node pointed to by \p ptrVal.
883863
///
884864
/// If \p ptrVal cannot be mapped to a node, return nullptr.

0 commit comments

Comments
 (0)