File tree Expand file tree Collapse file tree 2 files changed +9
-23
lines changed Expand file tree Collapse file tree 2 files changed +9
-23
lines changed Original file line number Diff line number Diff line change @@ -1081,12 +1081,15 @@ class LazyCallGraph {
1081
1081
1082
1082
// / Add new ref-recursive functions split/outlined from an existing function.
1083
1083
// /
1084
- // / The new functions may only reference the original function or other
1085
- // / functions that the original function did . New functions must not call
1086
- // / other new functions.
1084
+ // / The new functions may only reference other functions that the original
1085
+ // / function did. The new functions may reference the original function. New
1086
+ // / functions must not call other new functions or the original function .
1087
1087
// /
1088
- // / Mark the original function as referencing all new functions.
1089
- // / Mark all new functions as referencing each other.
1088
+ // / Marks the original function as referencing all new functions.
1089
+ // /
1090
+ // / The CG must be updated following the use of this helper, for example with
1091
+ // / updateCGAndAnalysisManagerForCGSCCPass(), to ensure the RefSCCs and SCCs
1092
+ // / are correctly identified.
1090
1093
void addSplitRefRecursiveFunctions (Function &OriginalFunction,
1091
1094
ArrayRef<Function *> NewFunctions);
1092
1095
Original file line number Diff line number Diff line change @@ -1733,23 +1733,6 @@ void LazyCallGraph::addSplitRefRecursiveFunctions(
1733
1733
}
1734
1734
}
1735
1735
1736
- for (Function *NewFunction : NewFunctions) {
1737
- Node &NewN = get (*NewFunction);
1738
- for (Function *OtherNewFunction : NewFunctions) {
1739
- if (NewFunction == OtherNewFunction)
1740
- continue ;
1741
-
1742
- Node &OtherNewN = get (*OtherNewFunction);
1743
-
1744
- // Don't add an edge if one already exists.
1745
- if (NewN->lookup (OtherNewN))
1746
- continue ;
1747
-
1748
- // Make the new function reference each other new function
1749
- NewN->insertEdgeInternal (OtherNewN, Edge::Kind::Ref);
1750
- }
1751
- }
1752
-
1753
1736
RefSCC *NewRC;
1754
1737
if (ExistsRefToOriginalRefSCC) {
1755
1738
// If there is any edge from any new function to any function in the
@@ -1793,7 +1776,7 @@ void LazyCallGraph::addSplitRefRecursiveFunctions(
1793
1776
if (F1 == F2)
1794
1777
continue ;
1795
1778
Node &N2 = get (*F2);
1796
- assert (N1->lookup (N2) &&
1779
+ assert (! N1->lookup (N2) ||
1797
1780
(!N1->lookup (N2)->isCall () &&
1798
1781
" Edges between new functions must be ref edges" ));
1799
1782
}
You can’t perform that action at this time.
0 commit comments