This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Inliner] Refactor the inliner to use nested pass pipelines instead of just canonicalization
ClosedPublic

Authored by rriddle on Nov 10 2020, 3:07 PM.

Details

Summary

Now that passes have support for running nested pipelines, the inliner can now allow for users to provide proper nested pipelines to use for optimization during inlining. This revision also changes the behavior of optimization during inlining to optimize before attempting to inline, which should lead to a more accurate cost model and prevents the need for users to schedule additional duplicate cleanup passes before/after the inliner that would already be run during inlining.

Diff Detail

Event Timeline

rriddle created this revision.Nov 10 2020, 3:07 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
rriddle requested review of this revision.Nov 10 2020, 3:07 PM

I don't quite get why you have to keep a separate builder callback for the default pass manager and build it on demand and cache it on every new encountered op name, why not just relying on the client adding it to the opPipelines StringMapwith an empty key for instance?

mlir/include/mlir/Pass/AnalysisManager.h
315–316

I'd explain that the operation has to be a transitive child: it can't be an arbitrary op

mlir/lib/Pass/Pass.cpp
872–873

Comment it out of sync

I don't quite get why you have to keep a separate builder callback for the default pass manager and build it on demand and cache it on every new encountered op name, why not just relying on the client adding it to the opPipelines StringMapwith an empty key for instance?

The problem is that, at present, a PassManager can't be constructed to run on any operation. It always requires the type of the operation that it is going to be scheduled on.

mehdi_amini accepted this revision.Nov 30 2020, 1:18 PM

Ah, of course...

This revision is now accepted and ready to land.Nov 30 2020, 1:18 PM
rriddle updated this revision to Diff 311756.Dec 14 2020, 6:09 PM
rriddle marked 2 inline comments as done.

Rebase

This revision was landed with ongoing or failed builds.Dec 14 2020, 6:28 PM
This revision was automatically updated to reflect the committed changes.