This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Use matchSimpleRecurrence to simplify some code in MVEGatherScatterLowering. NFCI
ClosedPublic

Authored by craig.topper on Jun 30 2021, 9:49 PM.

Diff Detail

Event Timeline

craig.topper created this revision.Jun 30 2021, 9:49 PM
craig.topper requested review of this revision.Jun 30 2021, 9:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2021, 9:49 PM

Looks nice. Like a good cleanup.

What made you look into the MVEGatherScatterLowering pass, out of interest?

Looks nice. Like a good cleanup.

What made you look into the MVEGatherScatterLowering pass, out of interest?

I've been trying to apply some portions of it to RISCV vectors. So far just the code to push computations out of the loop. One interesting thing I noticed is that MVEGatherScatterLowering can't push shl by a constant splat out of a loop. That would be the canonical IR for a multiply by a constant power of 2 splat.

dmgreen accepted this revision.Jul 8 2021, 9:24 AM

Oh yeah, I've seen shr come up before too. That was from gathers produced from x[i/2]. It's not one that we've got to yet. Constant factors of 2 are less common under MVE I think, because would usually use VLD2 instead.

So far just the code to push computations out of the loop.

Yesh, the other half of this might be pretty MVE specific, lowering the gathers to intrinsics. The exact forms of gathers supported in MVE is sometimes quite specific, and can require some of the optimizations here to lower them nicely.

This patch LGTM from what I can tell about matchSimpleRecurrence. Thanks for putting it together.

This revision is now accepted and ready to land.Jul 8 2021, 9:24 AM
This revision was landed with ongoing or failed builds.Jul 8 2021, 11:53 AM
This revision was automatically updated to reflect the committed changes.