This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Alter mull buildvectors(ext(..)) combine to work on shuffles
ClosedPublic

Authored by dmgreen on Apr 4 2022, 12:10 AM.

Details

Summary

D120018 altered this combine to work on buildvectors as opposed to shuffle dup's. This works well for dups and other things that are expanded into buildvectors. Some shuffles are legal though, and stay as vector_shuffle through lowering. This expands the transform to also handle shuffles, so that we can turn mul(shuffle(sext into mul(sext(shuffle and more readily make smull/umull instructions. This can come up from the SLP vectorizer adding shuffles that are costed from extends.

Diff Detail

Event Timeline

dmgreen created this revision.Apr 4 2022, 12:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2022, 12:10 AM
dmgreen requested review of this revision.Apr 4 2022, 12:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2022, 12:10 AM

Code looks good to me, but a small nitpick on the function name

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
13632–13635

As this no longer solely operates on BuildVector instructions, should the "Build" part of the function name be removed?

dmgreen updated this revision to Diff 420136.Apr 4 2022, 4:22 AM

Rename function to performBuildShuffleExtendCombine.

I've also limited shuffle's to be safe - just allowing SIGN_EXTEND or ZERO_EXTEND as the input. The input is a vector and calculatePreExtendType may not work as expected in those situations.

NickGuy accepted this revision.Apr 4 2022, 5:20 AM

LGTM

This revision is now accepted and ready to land.Apr 4 2022, 5:20 AM
This revision was landed with ongoing or failed builds.Apr 4 2022, 3:08 PM
This revision was automatically updated to reflect the committed changes.