[llvm] eb79e34 - [NFCI] Clean up idempotent stack pop for inline context (#141544)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 27 09:41:58 PDT 2025


Author: Mingming Liu
Date: 2025-05-27T09:41:54-07:00
New Revision: eb79e340a10fd0292c7fa2e3ca05895b8402f29e

URL: https://github.com/llvm/llvm-project/commit/eb79e340a10fd0292c7fa2e3ca05895b8402f29e
DIFF: https://github.com/llvm/llvm-project/commit/eb79e340a10fd0292c7fa2e3ca05895b8402f29e.diff

LOG: [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

Added: 
    

Modified: 
    llvm/lib/ProfileData/SampleProfReader.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp
index 343104ea25d1f..6466618aaa655 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(


        


More information about the llvm-commits mailing list