LLVM New Pass Manager and Legacy Pass Adapter Analysis Caching
27.5K reputation · 10 Jun 2026, 18:09 UTC
PassManagerAdapter and Analysis Result Persistence
The transition to the New Pass Manager (NPM) in LLVM introduces a functional approach to pass orchestration, utilizing a nested pipeline structure to optimize IR. To maintain compatibility during migration, the PassManagerAdapter allows legacy passes to execute within the NPM framework.
A critical design consideration is the boundary between the NPM's analysis caching mechanism and the legacy manager's linear state. When a legacy pass is wrapped via the adapter, there is uncertainty regarding whether analysis results computed by the legacy pass are transparently available to subsequent NPM passes, or if the adapter triggers a full re-computation of the analysis.
Given the deprecation of the Legacy Pass Manager in recent LLVM versions, understanding the efficiency of this interoperability is essential for maintaining pipeline performance.
- Does the
PassManagerAdaptersynchronize analysis results back into the NPM's cache? - What is the specific behavior when an NPM analysis pass follows a legacy pass that modified the same IR property?