Page MenuHomePhabricator

[TTI, AArch64] Add transpose shuffle kind
ClosedPublic

Authored by mssimpso on Apr 23 2018, 1:05 PM.

Details

Summary

This patch adds a new shuffle kind useful for transposing a 2xn matrix. These transpose shuffle masks read corresponding even- or odd-numbered vector elements from two n-dimensional source vectors and write each result into consecutive elements of an n-dimensional destination vector. The transpose shuffle kind is meant to model the TRN1 and TRN2 AArch64 instructions. As such, this patch also considers transpose shuffles in the AArch64 implementation of getShuffleCost.

Diff Detail

Repository
rL LLVM

Event Timeline

mssimpso created this revision.Apr 23 2018, 1:05 PM
javed.absar added inline comments.Apr 23 2018, 2:27 PM
include/llvm/Analysis/TargetTransformInfo.h
642 ↗(On Diff #143623)

Not sure why indentation change is needed

lib/Analysis/TargetTransformInfo.cpp
707 ↗(On Diff #143623)

would it be more accurate to say '..such that one vector contains _interleaved_ elements from all the even numbered rows ..."

737 ↗(On Diff #143623)

Test 4 and 5 could be perhaps combined into one loop?

mssimpso added inline comments.Apr 24 2018, 6:42 AM
include/llvm/Analysis/TargetTransformInfo.h
642 ↗(On Diff #143623)

Ah, clang-format decided to do that. I will undo the formatting for now.

lib/Analysis/TargetTransformInfo.cpp
707 ↗(On Diff #143623)

Sounds good to me.

737 ↗(On Diff #143623)

Yes, that would probably be a little more straightforward. Thanks!

mssimpso updated this revision to Diff 143737.Apr 24 2018, 7:03 AM
mssimpso marked 3 inline comments as done.

Addressed Javed's comments. Thanks!

javed.absar accepted this revision.Apr 24 2018, 12:57 PM

LGTM. Probably wait a day before committing in case Renato/others have a comment/suggestion.

This revision is now accepted and ready to land.Apr 24 2018, 12:57 PM

LGTM. Probably wait a day before committing in case Renato/others have a comment/suggestion.

Thanks for the review, Javed! Will do.

This revision was automatically updated to reflect the committed changes.