[PATCH] D82344: [NewPM] Make adaptor passes for pass managers unskippable

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 22 20:25:09 PDT 2020


ychen created this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
ychen retitled this revision from "[NewPM] Make adaptor passes unskippable from PassInstrumentation callbacks" to "[NewPM] Make adaptor passes unskippable".
ychen edited the summary of this revision.
ychen added reviewers: chandlerc, fedor.sergeev, asbirlea, echristo.
ychen retitled this revision from "[NewPM] Make adaptor passes unskippable" to "[NewPM] Make adaptor passes for pass managers unskippable".
ychen edited the summary of this revision.

PassInstrumentation before-pass-callbacks could be used to skip passes by returning false. Adaptor passes for pass managers are used to composite pass managers of different types. They could be skipped in two places: 1. the containing `PassManger<>:run`; 2. the adaptor class's run method such as `ModuleToFunctionPassAdaptor<>::run`.

Adaptor passes are implementation details that better be transparent to
the user-defined callbacks where users only care about real passes.

Callbacks are still invoked on adaptor passes. Just the return value of
before-pass-callbacks are not relevant after this patch.

I stumped upon this when implementing `llc -start/-stop` functionality
for new PM. I think this is general enough to improve the new pass
manager as well. Hence this patch.

Thoughts?

TODO: There are some code shuffling needed to make this work for
ModuleToPostOrderCGSCCPassAdaptor. (To forward declare nested class `class LazyCallGraph::SCC` by making it not nested).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82344

Files:
  llvm/include/llvm/Analysis/CGSCCPassManager.h
  llvm/include/llvm/IR/PassManager.h
  llvm/include/llvm/IR/PassManagerInternal.h
  llvm/include/llvm/Transforms/Scalar/LoopPassManager.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82344.272590.patch
Type: text/x-patch
Size: 5355 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200623/5eeb6570/attachment.bin>


More information about the llvm-commits mailing list