[all-commits] [llvm/llvm-project] be39e0: [IR] Inline remove_if in PMDataManager::removeNotP...
Fangrui Song via All-commits
all-commits at lists.llvm.org
Mon May 25 23:50:55 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: be39e065d325ad52628c23eb01d999656e30a22f
https://github.com/llvm/llvm-project/commit/be39e065d325ad52628c23eb01d999656e30a22f
Author: Fangrui Song <i at maskray.me>
Date: 2026-05-26 (Tue, 26 May 2026)
Changed paths:
M llvm/lib/IR/LegacyPassManager.cpp
Log Message:
-----------
[IR] Inline remove_if in PMDataManager::removeNotPreservedAnalysis (#199571)
PR #198982 rewrote removeNotPreservedAnalysis to use DenseMap::remove_if
with one predicate shared across two call sites. The predicate is always
inlined; the cost is that two call sites make
DenseMapBase::remove_if<...>
itself emit out of line instead of inlining into the caller. As this
runs
after every modifying codegen pass (legacy PM), it shows up as a small
instructions:u regression, most visibly at -O0 where the legacy codegen
PM
is a large fraction of compile time:
https://llvm-compile-time-tracker.com/compare.php?from=69a5cf515fd317bcf918e48de9137dd8549870c5&to=6302439f5aaea6cb776d8ceb5c2ef9108fccf702&stat=instructions%3Au
Collect the maps into a SmallVector and prune them from a single
remove_if
call site, so the instantiation is inlined again.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list