[PATCH] D76327: [Matrix] Also run LowerMatrixIntrinsics for -O0.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 09:12:26 PDT 2020


fhahn added a comment.

In D76327#1942729 <https://reviews.llvm.org/D76327#1942729>, @efriedma wrote:

> Normally most "must-run" passes are part of the codegen pipeline (TargetPassConfig).  It's convenient if the backend can handle arbitrary bitcode files without having to run some arbitrary set of "opt" passes first.


Thanks for pointing me to TargetPassConfig! Ideally the lowering pass would run unconditionally, but should be a no-op for functions that do not contain any matrix intrinsics. I think a good option would be to require the frontends to add an attribute ('may-contain-matrix-intrinsics') to functions that may contain matrix intrinsics. The LowerMatrixIntrinsics pass is run unconditionally, but bails out early for functions without the attribute. I've put up a patch D76857 <https://reviews.llvm.org/D76857>

This also should allow to add it unconditionally to TargetPassConfig and ensures that we do not run it unnecessarily in the backend again, if the intrinsics were already lowered in the middle-end: D76858 <https://reviews.llvm.org/D76858>

For running as part of the backend pipeline, I propose adding a simplified/minimal lowering pass, that only requires TTI, as we are planning on making the lowering pass more involved and running it in the backend should be last-resort kind of thing.

Does that approach seem reasonable?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76327/new/

https://reviews.llvm.org/D76327





More information about the llvm-commits mailing list