[llvm] [MemProf] Fix assert when exists direct recursion (PR #78264)
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 7 08:18:08 PST 2024
================
@@ -3470,17 +3470,19 @@ bool MemProfContextDisambiguation::applyImport(Module &M) {
auto *MIBMD = cast<const MDNode>(MDOp);
MDNode *StackMDNode = getMIBStackNode(MIBMD);
assert(StackMDNode);
- SmallVector<unsigned> StackIdsFromMetadata;
CallStack<MDNode, MDNode::op_iterator> StackContext(StackMDNode);
- for (auto ContextIter =
- StackContext.beginAfterSharedPrefix(CallsiteContext);
+ auto ContextIterBegin =
+ StackContext.beginAfterSharedPrefix(CallsiteContext);
+ // Skip the checking on the first iteration.
+ uint64_t LastStackContextId = *ContextIterBegin == 0 ? 1 : 0;
----------------
teresajohnson wrote:
https://github.com/llvm/llvm-project/pull/81008
https://github.com/llvm/llvm-project/pull/78264
More information about the llvm-commits
mailing list