This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Pass] Fix dropped statistics with nested adaptors.
ClosedPublic

Authored by dtzWill on Dec 6 2022, 1:59 PM.

Details

Summary

When running in parallel, nesting more than once caused
statistics to be dropped.

Fix by also preparing "async" pass managers before merging,
as they may also have "async" pass managers within.

Add test checking reported statistics have expected values
with and without threading enabled.

Diff Detail

Event Timeline

dtzWill created this revision.Dec 6 2022, 1:59 PM
Herald added a project: Restricted Project. · View Herald Transcript
dtzWill requested review of this revision.Dec 6 2022, 1:59 PM
rriddle accepted this revision.Dec 6 2022, 2:01 PM
This revision is now accepted and ready to land.Dec 6 2022, 2:01 PM

This fixes an issue in the CIRCT project where virtually none of our statistics worked with threading enabled: https://github.com/llvm/circt/issues/3513 .

As an aside, the test was based on pipeline-stats.mlir which I do not believe still needs to check for "0" values in the reported statistics, as now they're either enabled+reported or not reported at all (and the "REQUIRES: asserts" ensures they're enabled).

This revision was automatically updated to reflect the committed changes.