This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Add a tablegen pattern for UZP2.
ClosedPublic

Authored by labrinea on Dec 20 2021, 1:30 AM.

Details

Summary

Converts concat_vectors((trunc (lshr)), (trunc (lshr))) to UZP2 when the shift amount is half the width of the vector element.

Diff Detail

Event Timeline

labrinea created this revision.Dec 20 2021, 1:30 AM
labrinea requested review of this revision.Dec 20 2021, 1:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 20 2021, 1:30 AM
SjoerdMeijer added inline comments.Dec 21 2021, 2:02 AM
llvm/test/CodeGen/AArch64/uzp2.ll
5 ↗(On Diff #395391)

Just a nit about the tests: rather than adding a new file, would it make sense to keep all uzp2 tests together in existing file arm64-uzp.ll?

labrinea added inline comments.Dec 21 2021, 6:41 AM
llvm/test/CodeGen/AArch64/uzp2.ll
5 ↗(On Diff #395391)

Can do, but that file doesn't seem to test combination patterns. Maybe I could rename this file into something that indicates combine?

SjoerdMeijer accepted this revision.Dec 21 2021, 6:44 AM
SjoerdMeijer added inline comments.
llvm/test/CodeGen/AArch64/uzp2.ll
5 ↗(On Diff #395391)

Yeah, that would also work, e.g. arm64-uzp-combine.ll or something along those lines would group this together.

LGTM

This revision is now accepted and ready to land.Dec 21 2021, 6:44 AM
This revision was landed with ongoing or failed builds.Dec 21 2021, 8:30 AM
This revision was automatically updated to reflect the committed changes.

No, bad example, there it isn't obvious that there is a regression.
How about this one: https://godbolt.org/z/EeqjGW58x <- clear increase in instruction count.