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

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Mon May 26 21:58:57 PDT 2025


https://github.com/mingmingl-llvm created https://github.com/llvm/llvm-project/pull/141544

None

>From 384f9562d672a489889de09494d4eed0e35c4616 Mon Sep 17 00:00:00 2001
From: mingmingl <mingmingl at google.com>
Date: Thu, 15 May 2025 10:05:57 -0700
Subject: [PATCH 1/2] clang-format

---
 llvm/lib/ProfileData/InstrProfWriter.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/llvm/lib/ProfileData/InstrProfWriter.cpp b/llvm/lib/ProfileData/InstrProfWriter.cpp
index 2759346935b14..9dc1a0d0b4678 100644
--- a/llvm/lib/ProfileData/InstrProfWriter.cpp
+++ b/llvm/lib/ProfileData/InstrProfWriter.cpp
@@ -152,9 +152,7 @@ void InstrProfWriter::setValueProfDataEndianness(llvm::endianness Endianness) {
   InfoObj->ValueProfDataEndianness = Endianness;
 }
 
-void InstrProfWriter::setOutputSparse(bool Sparse) {
-  this->Sparse = Sparse;
-}
+void InstrProfWriter::setOutputSparse(bool Sparse) { this->Sparse = Sparse; }
 
 void InstrProfWriter::addRecord(NamedInstrProfRecord &&I, uint64_t Weight,
                                 function_ref<void(Error)> Warn) {

>From a10baa70c3daab57d091ef5263ec54b6bcc5e9ce Mon Sep 17 00:00:00 2001
From: mingmingl <mingmingl at google.com>
Date: Mon, 26 May 2025 17:25:56 -0700
Subject: [PATCH 2/2] [NFCI]Clean up idempotent stack pop for inline context

---
 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 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