This is an archive of the discontinued LLVM Phabricator instance.

[Matrix] Add may-contain-matrix-intrinsics attribute, unconditionally run lowering
Needs ReviewPublic

Authored by fhahn on Mar 26 2020, 9:03 AM.

Details

Summary

This patch adds a new may-contain-matrix-intrinsics attribute to allow
frontends to mark a functions as requiring matrix lowering. This allows
us to run the LowerMatrixIntrinsics pass unconditionally, with it being
a no-op for functions without that attribute.

The main reason for introducing the attribute is to avoid doing an
unnecessary pass over each function in the lowering pass. This approach
should also works seamlessly with LTO combining modules built with and
without matrix support enabled.

This patch also extends the IR verifier to reject functions that contain
matrix intrinsics but are not marked as may-contain-matrix-intrinsics.

Diff Detail