This is an archive of the discontinued LLVM Phabricator instance.

[mlir][VectorOps] Implement canonicalization for TransposeOp.

Authored by grosul1 on Apr 2 2020, 12:28 PM.



[mlir][VectorOps] Implement canonicalization for TransposeOp.

Two back-to-back transpose operations are combined into a single transpose, which uses a combination of their permutation vectors.

Diff Detail

Event Timeline

grosul1 created this revision.Apr 2 2020, 12:28 PM
Herald added a project: Restricted Project. · View Herald Transcript
grosul1 edited the summary of this revision. (Show Details)Apr 2 2020, 12:29 PM
grosul1 added a reviewer: nicolasvasilache.
bondhugula added inline comments.

Nit: no need of the ref (all derived ops are just one pointer size).


Use dyn_cast_or_null ?

auto parentTransposeOp = dyn_cast_or_null(transposeOp.vector().getDefiningOp());
if (!parentTransposeOp)
  return failure();
grosul1 updated this revision to Diff 254613.Apr 2 2020, 1:45 PM

Address Uday's comments

grosul1 marked 2 inline comments as done.Apr 2 2020, 1:48 PM
grosul1 added inline comments.

Smaller is better, thanks!

grosul1 updated this revision to Diff 254633.Apr 2 2020, 3:22 PM

Existing code uses both styles, but the build fails for the new code. Change
get_permutation -> getPermutation and compose_permutations -> composePermutations.

nicolasvasilache accepted this revision.Apr 2 2020, 5:42 PM
This revision is now accepted and ready to land.Apr 2 2020, 5:42 PM
This revision was automatically updated to reflect the committed changes.
rriddle added inline comments.Apr 2 2020, 7:20 PM

Please use /// for top-level comments.