HomePhabricator

[NewPM][PassInstrument] Add PrintPass callback to StandardInstrumentations

Authored by ychen on Jul 28 2020, 5:08 PM.

Description

[NewPM][PassInstrument] Add PrintPass callback to StandardInstrumentations

Problem:
Right now, our "Running pass" is not accurate when passes are wrapped in adaptor because adaptor is never skipped and a pass could be skipped. The other problem is that "Running pass" for a adaptor is before any "Running pass" of passes/analyses it depends on. (for example, FunctionToLoopPassAdaptor). So the order of printing is not the actual order.

Solution:
Doing things like PassManager::Debuglogging is very intrusive because we need to specify Debuglogging whenever adaptor is created. (Actually, right now we're not specifying Debuglogging for some sub-PassManagers. Check PassBuilder)

This patch move debug logging for pass as a PassInstrument callback. We could be sure that all running passes are logged and in the correct order.

This could also be used to implement hierarchy pass logging in legacy PM. We could also move logging of pass manager to this if we want.

The test fixes looks messy. It includes changes:

  • Remove PassInstrumentationAnalysis
  • Remove PassAdaptor
  • If a PassAdaptor is for a real pass, the pass is added
  • Pass reorder (to the correct order), related to PassAdaptor
  • Add missing passes (due to Debuglogging not passed down)

Reviewed By: asbirlea, aeubanks

Differential Revision: https://reviews.llvm.org/D84774

Details

Committed
ychenJul 30 2020, 10:07 AM
Reviewer
asbirlea
Differential Revision
D84774: [NewPM][PassInstrument] Add PrintPass callback to StandardInstrumentations
Parents
rG3632f765dc6a: [WebAssembly] Fix GCC 5 build.
Branches
Unknown
Tags
Unknown