[llvm-dev] Use new Pass Manager for CodeGen (new)

via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 18 13:12:15 PDT 2019


Hello,

Charlie spent some time on using new Pass Manager for CodeGen in this summer. 
(http://lists.llvm.org/pipermail/llvm-dev/2019-June/133063.html) The initial 
interface design is here https://reviews.llvm.org/D64179. I think Fedor asked 
some questions that make perfect sense and I am trying to address these issues
in a new patch https://reviews.llvm.org/D67687.

(For high-level view of the new PM, Duncan's summary is a great start  
http://lists.llvm.org/pipermail/llvm-dev/2014-June/073876.html)

In short, I think a machine function pass only pipeline should be able to perform 
the CodeGen (currently SelectionDAGISel and AsmPrinter are both 
MachineFunctionPass in legacy Pass Manager). There are no need for proxy or 
adaptor classes since cross-IR unit activities like invalidation does not exist. 
The new machine function pass could query either machine function analysis (
invalidation is possible) or IR unit analysis such as Module or Function analysis 
(invalidation is not possible). Machine function analysis are exposed via the
interface AnalysisManager<MachineFunction>; IR unit analysis are exposed by 
these managers that are used for Opt where some cached results are still valid
to reduce recomputation.

The unit test in https://reviews.llvm.org/D67687 demonstrates the expected usage
 of this new interface.

Does this interface look complete for the purpose of CodeGen? Are there some other
pieces you think should be here? Any comments and suggestions are greatly appreciated.

- Yuanfang



More information about the llvm-dev mailing list