This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Sink splat shuffles to lane index intrinsics
ClosedPublic

Authored by dmgreen on Nov 2 2021, 2:30 AM.

Details

Summary

This teaches AArch64TargetLowering::shouldSinkOperands to sink splat shuffles to certain neon intrinsics, so that they can make use of the lane variants of the instructions that are available.

Diff Detail

Event Timeline

dmgreen created this revision.Nov 2 2021, 2:30 AM
dmgreen requested review of this revision.Nov 2 2021, 2:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 2 2021, 2:30 AM
samtebbs added inline comments.Nov 2 2021, 3:26 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
11952–11960

I don't know much about the sinking test coverage, but would a test for when Ops is empty here be beneficial?

dmgreen updated this revision to Diff 384395.Nov 3 2021, 4:35 AM
dmgreen added inline comments.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
11952–11960

I think that would be a common case, but I'm not sure we have any specific tests for it. I've added a smull_nonsplat tests which should cover it, but won't show any codegen differences.

samtebbs added inline comments.Nov 10 2021, 2:39 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
11952–11960

Thanks! I don't see the smull_nonsplat in the diff though.

dmgreen added inline comments.Nov 10 2021, 6:25 AM
llvm/test/CodeGen/AArch64/sinksplat.ll
333

It's here (granted not very obviously) - it didn't change because it won't be sunk if the shuffle is not a splat.

samtebbs accepted this revision.Nov 10 2021, 6:34 AM

LGTM!

llvm/test/CodeGen/AArch64/sinksplat.ll
333

Ah, great :)

This revision is now accepted and ready to land.Nov 10 2021, 6:34 AM
This revision was landed with ongoing or failed builds.Nov 22 2021, 12:11 AM
This revision was automatically updated to reflect the committed changes.