[llvm] [MemProf] Don't skip direct recursion in function summary (PR #78264)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 16 03:57:10 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-analysis
Author: None (lifengxiang1025)
<details>
<summary>Changes</summary>
I met one assert in `MemProfContextDisambiguation::applyImport` because metadata doesn't match summary. The reason is function summary skip direct recursion but metadata donen't.
---
Full diff: https://github.com/llvm/llvm-project/pull/78264.diff
1 Files Affected:
- (modified) llvm/lib/Analysis/ModuleSummaryAnalysis.cpp (+1-5)
``````````diff
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
index 1f15e94783240a..7e09192c5f1d51 100644
--- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
@@ -499,11 +499,7 @@ static void computeFunctionSummary(
StackContext.beginAfterSharedPrefix(InstCallsite);
ContextIter != StackContext.end(); ++ContextIter) {
unsigned StackIdIdx = Index.addOrGetStackIdIndex(*ContextIter);
- // If this is a direct recursion, simply skip the duplicate
- // entries. If this is mutual recursion, handling is left to
- // the LTO link analysis client.
- if (StackIdIndices.empty() || StackIdIndices.back() != StackIdIdx)
- StackIdIndices.push_back(StackIdIdx);
+ StackIdIndices.push_back(StackIdIdx);
}
MIBs.push_back(
MIBInfo(getMIBAllocType(MIBMD), std::move(StackIdIndices)));
``````````
</details>
https://github.com/llvm/llvm-project/pull/78264
More information about the llvm-commits
mailing list