@@ -127,14 +127,14 @@ static cl::opt<bool> AllowRecursiveCallsites(
127127 " memprof-allow-recursive-callsites" , cl::init(true ), cl::Hidden,
128128 cl::desc(" Allow cloning of callsites involved in recursive cycles" ));
129129
130- // When enabled , try to detect and prevent cloning of recursive contexts.
130+ // When disabled , try to detect and prevent cloning of recursive contexts.
131131// This is only necessary until we support cloning through recursive cycles.
132- // Leave off by default for now, as it requires a little bit of compile time
133- // overhead and doesn't affect correctness, it will just inflate the cold hinted
134- // bytes reporting a bit when -memprof-report-hinted-sizes is enabled.
135- static cl::opt<bool > SkipRecursiveContexts (
136- " memprof-skip -recursive-contexts" , cl::init(false ), cl::Hidden,
137- cl::desc(" Prevent cloning of contexts through recursive cycles" ));
132+ // Leave on by default for now, as disabling requires a little bit of compile
133+ // time overhead and doesn't affect correctness, it will just inflate the cold
134+ // hinted bytes reporting a bit when -memprof-report-hinted-sizes is enabled.
135+ static cl::opt<bool > AllowRecursiveContexts (
136+ " memprof-allow -recursive-contexts" , cl::init(true ), cl::Hidden,
137+ cl::desc(" Allow cloning of contexts through recursive cycles" ));
138138
139139namespace llvm {
140140cl::opt<bool > EnableMemProfContextDisambiguation (
@@ -1394,9 +1394,9 @@ static void checkNode(const ContextNode<DerivedCCG, FuncTy, CallTy> *Node,
13941394 }
13951395 // Node can have more context ids than callers if some contexts terminate at
13961396 // node and some are longer. If we are allowing recursive callsites but
1397- // haven't enabled skipping of recursive contexts, this will be violated for
1397+ // haven't disabled recursive contexts, this will be violated for
13981398 // incompletely cloned recursive cycles, so skip the checking in that case.
1399- assert ((AllowRecursiveCallsites && !SkipRecursiveContexts ) ||
1399+ assert ((AllowRecursiveCallsites && AllowRecursiveContexts ) ||
14001400 NodeContextIds == CallerEdgeContextIds ||
14011401 set_is_subset (CallerEdgeContextIds, NodeContextIds));
14021402 }
@@ -3392,10 +3392,9 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::identifyClones(
33923392 assert (Node->AllocTypes != (uint8_t )AllocationType::None);
33933393
33943394 DenseSet<uint32_t > RecursiveContextIds;
3395- // If we are allowing recursive callsites, and have also enabled
3396- // skipping of recursive contexts, look for context ids that show up in
3397- // multiple caller edges.
3398- if (AllowRecursiveCallsites && SkipRecursiveContexts) {
3395+ // If we are allowing recursive callsites, but have also disabled recursive
3396+ // contexts, look for context ids that show up in multiple caller edges.
3397+ if (AllowRecursiveCallsites && !AllowRecursiveContexts) {
33993398 DenseSet<uint32_t > AllCallerContextIds;
34003399 for (auto &CE : Node->CallerEdges ) {
34013400 // Resize to the largest set of caller context ids, since we know the
0 commit comments