From eb79e340a10fd0292c7fa2e3ca05895b8402f29e Mon Sep 17 00:00:00 2001 From: Mingming Liu Date: Tue, 27 May 2025 09:41:54 -0700 Subject: [PATCH] [NFCI] Clean up idempotent stack pop for inline context (#141544) In the top-of-tree, the stack pops at L414-416 [1] are no-op since there are prior stack pops at L400-402. [1] https://github.com/llvm/llvm-project/blame/e015626f189dc76f8df9fdc25a47638c6a2f3feb/llvm/lib/ProfileData/SampleProfReader.cpp#L414-L416 [2] https://github.com/llvm/llvm-project/blame/e015626f189dc76f8df9fdc25a47638c6a2f3feb/llvm/lib/ProfileData/SampleProfReader.cpp#L400-L402 --- llvm/lib/ProfileData/SampleProfReader.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp index 343104ea25d1..6466618aaa65 100644 --- a/llvm/lib/ProfileData/SampleProfReader.cpp +++ b/llvm/lib/ProfileData/SampleProfReader.cpp @@ -411,9 +411,6 @@ std::error_code SampleProfileReaderText::readImpl() { break; } case LineType::BodyProfile: { - while (InlineStack.size() > Depth) { - InlineStack.pop_back(); - } FunctionSamples &FProfile = *InlineStack.back(); for (const auto &name_count : TargetCountMap) { mergeSampleProfErrors(Result, FProfile.addCalledTargetSamples(