This is an archive of the discontinued LLVM Phabricator instance.

[ARM][MVE] Enable masked scatter
ClosedPublic

Authored by anwel on Jan 16 2020, 9:15 AM.

Details

Summary

This patch extends the gather/scatter pass in MVEGatherScatterLowering.cpp to enable the transformation of masked scatters into calls to arm's masked scatter intrinsic.

Diff Detail

Event Timeline

anwel created this revision.Jan 16 2020, 9:15 AM
dmgreen added inline comments.Jan 17 2020, 7:59 AM
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
542 ↗(On Diff #238523)

This can just call isLegalMaskedGather, like we do for isLegalMaskedStore

llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
292

This looks like it's gone back to an older version?

458–464

This might be better as

bool Changed = false;
for (IntrinsicInst *I : Gathers)
  Changed |= lowerGather(I);
for (IntrinsicInst *I : Scatters)
  Changed |= lowerScatter(I);

As we might not be altering the gathers/scatters that we see, leaving them for the legalise pass to scalarise.

anwel marked 6 inline comments as done.Jan 20 2020, 3:04 AM
anwel added inline comments.
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
542 ↗(On Diff #238523)

Fair point.

llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
292

I think you are right. Thanks for catching that.

458–464

Good point. We do get the booleans from the functions' return value, so we should be using it.

anwel updated this revision to Diff 239049.Jan 20 2020, 3:05 AM
anwel marked 3 inline comments as done.
dmgreen accepted this revision.Jan 20 2020, 7:34 AM

LGTM. Thanks.

llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
458–459

You probably don't need these two lines any more.

This revision is now accepted and ready to land.Jan 20 2020, 7:34 AM
anwel marked 2 inline comments as done.Jan 20 2020, 8:52 AM
anwel added inline comments.
llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
458–459

No, I don't. Thanks for spotting.

anwel updated this revision to Diff 239149.Jan 20 2020, 8:53 AM
anwel marked an inline comment as done.
This revision was automatically updated to reflect the committed changes.