This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Match G_SHUFFLE_VECTOR -> insert elt + extract elt
ClosedPublic

Authored by paquette on Feb 22 2021, 11:38 AM.

Details

Summary

Match a G_SHUFFLE_VECTOR with a mask that allows it to be represented as a G_INSERT_VECTOR_ELT and a G_EXTRACT_VECTOR_ELT.

This ports isINSMask from AArch64ISelLowering and the portion of AArch64TargetLowering::LowerVECTOR_SHUFFLE which handles the equivalent transformation.

This provides more opportunities for matching DUP. We don't have all of the necessary combines to actually make DUP out of these yet, but this is better for size than the full TBL expansion for G_SHUFFLE_VECTOR.

This is a -0.1% code size improvement on CTMark/Bullet at -Os.

IR example: https://godbolt.org/z/sdcevT

Diff Detail

Event Timeline

paquette created this revision.Feb 22 2021, 11:38 AM
paquette requested review of this revision.Feb 22 2021, 11:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2021, 11:38 AM
aemerson accepted this revision.Feb 22 2021, 2:08 PM

Looks a reasonable port.

This revision is now accepted and ready to land.Feb 22 2021, 2:08 PM
thakis added a subscriber: thakis.Feb 22 2021, 4:03 PM

Looks like this breaks tests on windows: http://45.33.8.238/win/33724/step_11.txt

Please take a look, and revert for now if it takes a while to fix.