This is an archive of the discontinued LLVM Phabricator instance.

[ARM] MVE VLDn addressing modes
ClosedPublic

Authored by dmgreen on Dec 9 2019, 3:34 AM.

Details

Summary

This adds Post inc variants of the VLD2/4 and VST2/4 instructions in MVE. It uses the same mechanism/nodes as Neon, transforming the intrinsic+add pair into a ARMISD::VLD2_UPD, which gets selected to a post-inc instruction. The code to do that is mostly taken from the existing Neon code, but simplified as less variants are needed.

It also fills in some getTgtMemIntrinsic for the arm.mve.vld2/4 instrinsics, which allow the nodes to have MMO's, calculated as the full length to the memory being loaded/stored.

Diff Detail

Event Timeline

dmgreen created this revision.Dec 9 2019, 3:34 AM
simon_tatham added inline comments.Jan 15 2020, 1:15 AM
llvm/lib/Target/ARM/ARMISelLowering.cpp
13349

If I understand this part right, it's trying to arrange that the IR intrinsics for vld2/vst2 are turned into something that can be writeback-optimized. But there don't seem to be many tests of that part – I saw one test that had a vld2q intrinsic call, but no tests of vld4, or stores.

dmgreen marked an inline comment as done.Jan 15 2020, 2:31 AM
dmgreen added inline comments.
llvm/lib/Target/ARM/ARMISelLowering.cpp
13349

Oh yeah, I can add some of those.

The way these work at the moment is that we convert the code in these mve-vst2.ll tests (the shuffle and the loads) into the mve intrinsics in the InterleaveAccessPass and lowerInterleavedLoad. So these tests are testing the, just not directly.

I can add some more direct tests too. That sounds like a good idea.

dmgreen updated this revision to Diff 238203.Jan 15 2020, 2:44 AM

I just copied the existing tests with post-inc versions.

simon_tatham accepted this revision.Jan 15 2020, 3:37 AM

OK, this LGTM from the point of view of what's happening in the tests.

But, fair warning, I'm not a great expert on isel lowering! So if you need a reviewer to spot subtle mistakes in PerformMVEVLDCombine then you might still need to look for someone else to comment.

This revision is now accepted and ready to land.Jan 15 2020, 3:37 AM

Thanks! This is mostly a copy of the existing Neon code, adjusted for MVE. Hopefully fairly straight forward.

I will leave it for a couple of days, in case anyone else has any comments. (I just noticed I do need to clang-format it though! Will make sure I do that before committing).

This revision was automatically updated to reflect the committed changes.