First, sink the transposes to the operands to simplify redudant
ones. Then, lift them to reduce the number of realized transposes.
(A + B)^T -> A^T + B^T -> (A + B)^T
See tests for more examples.
Paths
| Differential D133657
[Matrix] Optimize matrix transposes around additions ClosedPublic Authored by thegameg on Sep 10 2022, 10:44 PM.
Details Summary First, sink the transposes to the operands to simplify redudant (A + B)^T -> A^T + B^T -> (A + B)^T See tests for more examples.
Diff Detail
Unit TestsFailed
Event Timelinethegameg added a parent revision: D133656: [Matrix] Add tests for addition transpose optimizations.Sep 10 2022, 10:46 PM
thegameg marked 4 inline comments as done. thegameg added inline comments.
This revision is now accepted and ready to land.Jan 11 2023, 8:07 AM This revision was landed with ongoing or failed builds.Jan 11 2023, 3:23 PM Closed by commit rGda09b35334ab: [Matrix] Optimize matrix transposes around additions (authored by thegameg). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 459326 llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
llvm/test/Transforms/LowerMatrixIntrinsics/after-transpose-opts.ll
llvm/test/Transforms/LowerMatrixIntrinsics/propagate-backward.ll
|
Now also supports adds.