This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][NFC] Add annotation printer hook
Needs ReviewPublic

Authored by Tyker on Nov 16 2022, 4:51 PM.

Details

Summary

The intended use of printer hooks is for analysis to have an easy way to print there results
in comments inside the IR.
The PrinterHookBase doesn't provide default implementation because the printer is most often used without an hook.
And a virtual call is much slower then a branch.

Diff Detail

Event Timeline

Tyker created this revision.Nov 16 2022, 4:51 PM
Tyker requested review of this revision.Nov 16 2022, 4:51 PM

Thanks, haven't looked at all but will when I get a chance (either tonight or tomorrow).

This seems quite intrusive to me, and the naming is a bit vague as well, I'm not totally sure how to think about this.

(also we'll need tests here)