@@ -1917,8 +1917,11 @@ class PartitionOpTranslator {
1917
1917
1918
1918
SILFunction *function;
1919
1919
1920
- // / A cache of argument IDs.
1921
- std::optional<Partition> functionArgPartition;
1920
+ // / The initial partition of the entry block.
1921
+ // /
1922
+ // / This contains a single region for non-sending parameters as well as
1923
+ // / separate regions for each sending parameter.
1924
+ std::optional<Partition> initialEntryBlockPartition;
1922
1925
1923
1926
// / A builder struct that we use to convert individual instructions into lists
1924
1927
// / of PartitionOps.
@@ -1983,7 +1986,7 @@ class PartitionOpTranslator {
1983
1986
PartitionOpTranslator (SILFunction *function, PostOrderFunctionInfo *pofi,
1984
1987
RegionAnalysisValueMap &valueMap,
1985
1988
IsolationHistory::Factory &historyFactory)
1986
- : function(function), functionArgPartition (), builder(),
1989
+ : function(function), initialEntryBlockPartition (), builder(),
1987
1990
partialApplyReachabilityDataflow (function, valueMap, pofi),
1988
1991
valueMap(valueMap) {
1989
1992
builder.translator = this ;
@@ -2006,8 +2009,8 @@ class PartitionOpTranslator {
2006
2009
auto functionArguments = function->getArguments ();
2007
2010
if (functionArguments.empty ()) {
2008
2011
REGIONBASEDISOLATION_LOG (llvm::dbgs () << " None.\n " );
2009
- functionArgPartition = Partition::singleRegion (SILLocation::invalid (), {},
2010
- historyFactory.get ());
2012
+ initialEntryBlockPartition = Partition::singleRegion (
2013
+ SILLocation::invalid (), {}, historyFactory.get ());
2011
2014
return ;
2012
2015
}
2013
2016
@@ -2044,10 +2047,10 @@ class PartitionOpTranslator {
2044
2047
}
2045
2048
}
2046
2049
2047
- functionArgPartition = Partition::singleRegion (
2050
+ initialEntryBlockPartition = Partition::singleRegion (
2048
2051
SILLocation::invalid (), nonSendableJoinedIndices, historyFactory.get ());
2049
2052
for (Element elt : nonSendableSeparateIndices) {
2050
- functionArgPartition ->trackNewElement (elt);
2053
+ initialEntryBlockPartition ->trackNewElement (elt);
2051
2054
}
2052
2055
}
2053
2056
@@ -2116,8 +2119,10 @@ class PartitionOpTranslator {
2116
2119
public:
2117
2120
// / Return the partition consisting of all function arguments.
2118
2121
// /
2119
- // / Used to initialize the entry blocko of our analysis.
2120
- const Partition &getEntryPartition () const { return *functionArgPartition; }
2122
+ // / Used to initialize the initial partition of the entry block of the CFG.
2123
+ const Partition &getInitialEntryPartition () const {
2124
+ return *initialEntryBlockPartition;
2125
+ }
2121
2126
2122
2127
// / Get the results of an apply instruction.
2123
2128
// /
@@ -4139,7 +4144,7 @@ RegionAnalysisFunctionInfo::RegionAnalysisFunctionInfo(
4139
4144
}
4140
4145
// Set our entry partition to have the "entry partition".
4141
4146
(*blockStates)[fn->getEntryBlock ()].entryPartition =
4142
- translator->getEntryPartition ();
4147
+ translator->getInitialEntryPartition ();
4143
4148
runDataflow ();
4144
4149
}
4145
4150
0 commit comments