This is an archive of the discontinued LLVM Phabricator instance.

[SVE][CodeGen] Add support for scalable vectors in AArch64TargetLowering::ReconstructShuffle
Needs ReviewPublic

Authored by david-arm on Feb 10 2022, 4:14 AM.

Details

Summary

At the moment if AArch64TargetLowering::ReconstructShuffle encounters
a scalable vector it just bails out of the optimisation entirely.
However, there are cases when we can make the transformation succeed
and produce far better code than if we just immediately bail out.

You can see the codegen improvement in the following tests:

CodeGen/AArch64/sve-fixed-length-reshuffle.ll

I have tried to highlight in sve-fixed-length-reshuffle.ll those tests
that exercise the AArch64TargetLowering::ReconstructShuffle code path
when the transformation succeeds or fails.

Diff Detail

Event Timeline

david-arm created this revision.Feb 10 2022, 4:14 AM
david-arm requested review of this revision.Feb 10 2022, 4:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 10 2022, 4:14 AM
paulwalker-arm added inline comments.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
9048

When protecting code can you check the positive rather than the negative. So if (SrcVTSize.isFixed() && ...). Looking at TypeSize suggests there's no such function, but I think that's an omission.

david-arm updated this revision to Diff 407503.Feb 10 2022, 5:43 AM
Matt added a subscriber: Matt.Mar 17 2022, 5:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2022, 5:57 PM