This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Vector] Canonicalize create_mask(transpose)
ClosedPublic

Authored by dcaballe on Mar 15 2023, 9:16 PM.

Details

Summary

When applying vector masking we may create a mask and then transpose it.
Transpositions are extremely expensive so this patch introduces a new
canonicalization pattern that remove the tranpose operation and create a
new transposed mask.

Diff Detail

Event Timeline

dcaballe created this revision.Mar 15 2023, 9:16 PM
Herald added a project: Restricted Project. · View Herald Transcript
dcaballe requested review of this revision.Mar 15 2023, 9:16 PM
nicolasvasilache accepted this revision.Mar 16 2023, 6:47 AM

LGTM but please make the test a 3-D test with a permutation such as [1, 2, 0]

mlir/test/Dialect/Vector/canonicalize.mlir
63

Can we make a 3-D example where permutation != permutation^-1 ?
2d examples are always special cases and hide mistakes.

This revision is now accepted and ready to land.Mar 16 2023, 6:47 AM
dcaballe marked an inline comment as done.Mar 16 2023, 7:27 AM
This revision was landed with ongoing or failed builds.Mar 16 2023, 7:37 AM
This revision was automatically updated to reflect the committed changes.