[llvm] [MemProf] Avoid assertion checking loop under NDEBUG (NFC) (PR #138985)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Wed May 7 16:35:56 PDT 2025


================
@@ -5242,6 +5242,7 @@ bool MemProfContextDisambiguation::applyImport(Module &M) {
           assert(AI != FS->allocs().end());
           auto &AllocNode = *(AI++);
 
+#ifndef NDEBUG
           // Sanity check that the MIB stack ids match between the summary and
           // instruction metadata.
           auto MIBIter = AllocNode.MIBs.begin();
----------------
snehasish wrote:

Can we refactor this out to a static helper? I think it should be straightforward since the only live ins for this region are AllocNode and MemProfMD as far as I can tell.

https://github.com/llvm/llvm-project/pull/138985


More information about the llvm-commits mailing list