Skip to content

Commit 1dbfbb5

Browse files
[MemProf] Stop cloning traversal on single allocation type (#126131)
We were previously checking this after recursing on all callers, but if we already have a single allocation type there is no need to even look at any callers. Didn't show a significant improvement overall, but it does reduce the count of times we enter the identifyClones and do other checks.
1 parent 74c2e9a commit 1dbfbb5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3407,6 +3407,10 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::identifyClones(
34073407
if (!Node->hasCall())
34083408
return;
34093409

3410+
// No need to look at any callers if allocation type already unambiguous.
3411+
if (hasSingleAllocType(Node->AllocTypes))
3412+
return;
3413+
34103414
#ifndef NDEBUG
34113415
auto Insert =
34123416
#endif

0 commit comments

Comments
 (0)