This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SME]: Scalarize masked gather/scatter in streaming mode
ClosedPublic

Authored by hassnaa-arm on Nov 23 2022, 9:27 AM.

Details

Summary

To generate code compatible to streaming mode:

  • Force scalarizing masked gather/scatter.

Testing files:

  • expand-masked-gather.ll
  • expand-masked-scatter.ll

Diff Detail

Event Timeline

hassnaa-arm created this revision.Nov 23 2022, 9:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 23 2022, 9:27 AM
hassnaa-arm requested review of this revision.Nov 23 2022, 9:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 23 2022, 9:27 AM

Are code generation tests all that useful for this patch? The change really affects the ScalarizeMaskedMem pass so the code generator never sees a call to gather or scatter intrinsics, which is presumably why they're no existing NEON code generation tests for these intrinsics. Perhaps instead you want to create an AArch64 version of llvm/test/Transforms/ScalarizeMaskedMemIntrin/X86/expand-masked-gather.ll (and expand-masked-scatter.ll)? Given the code change is independent of the vector length I also doubt you need to go so wide with your the number of vector lengths tested. Perhaps a test per element type and vary the vector length across those tests is enough.

There might still be an issue where some other code can create a GATHER ISD node during code generation but none of the current tests test such a scenario and so we can worry about that later. This patch is all about ensuring ScalarizeMaskedMem does what we need when in streaming mode.

Add testing files for scalarizing gather/scatter
Remove masked gather/scatter testing files related to code generation.

hassnaa-arm retitled this revision from [AArch64][SME]: Generate streaming-compatible code for scatter/gather to [AArch64][SME]: Scalarize masked gather/scatter in streaming mode.Nov 29 2022, 8:44 AM
hassnaa-arm edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Nov 30 2022, 4:11 AM
sdesmalen added inline comments.Nov 30 2022, 6:56 AM
llvm/test/Transforms/ScalarizeMaskedMemIntrin/AArch64/expand-masked-gather.ll
1 ↗(On Diff #478618)

Is it worth moving both tests to a file called streaming-compatible-expand-masked-gather-scatter.ll ?

33–64 ↗(On Diff #478618)

These tests don't add much value in testing the expansion of the intrinsic with the code you've written, so can just as well be removed.

llvm/test/Transforms/ScalarizeMaskedMemIntrin/AArch64/expand-masked-scatter.ll
4 ↗(On Diff #478618)

can you use opaque pointers, so <2 x ptr> ?

31–62 ↗(On Diff #478618)

These tests don't add much value in testing the expansion of the intrinsic with the code you've written, so can just as well be removed.

hassnaa-arm marked 4 inline comments as done.Nov 30 2022, 7:20 AM

Use opaque PTRs, Remove not needed tests.

Merge testing files gather & scatter into one gather-scatter file

sdesmalen added inline comments.Nov 30 2022, 7:40 AM
llvm/test/Transforms/ScalarizeMaskedMemIntrin/AArch64/expand-masked-gather.ll
1 ↗(On Diff #478946)

For this patch, I don't think you have to add any files in a precursory patch. There's not much value in that since we're not looking at a subtle differences in assembly.
In that case, there is also no need to 'delete' any files.

hassnaa-arm marked an inline comment as done.Nov 30 2022, 8:04 AM

Drop the precursory patch

sdesmalen accepted this revision.Nov 30 2022, 8:05 AM

Thanks!

This revision was landed with ongoing or failed builds.Nov 30 2022, 6:54 PM
This revision was automatically updated to reflect the committed changes.

This test is failing on our bot that only builds the ARM target - https://lab.llvm.org/buildbot/#/builders/245/builds/1637

Is that command line option only available when you have AArch64?

This test is failing on our bot that only builds the ARM target - https://lab.llvm.org/buildbot/#/builders/245/builds/1637

Is that command line option only available when you have AArch64?

Hi @DavidSpickett, hopefully I've fixed this with commit a043fcf92fa3

That did the trick, thanks.