This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner][SVE] Ensure MGATHER/MSCATTER addressing mode combines preserve index scaling
ClosedPublic

Authored by paulwalker-arm on Apr 6 2022, 8:12 AM.

Details

Summary

refineUniformBase and selectGatherScatterAddrMode both attempt the
transformation:

base(0) + index(A+splat(B)) => base(B) + index(A)

However, this is only safe when index is not implicitly scaled.

Diff Detail

Event Timeline

paulwalker-arm created this revision.Apr 6 2022, 8:12 AM
Herald added a project: Restricted Project. · View Herald Transcript
paulwalker-arm requested review of this revision.Apr 6 2022, 8:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2022, 8:12 AM

This patch doesn't fix all the issues I've spotted with selectGatherScatterAddrMode but because D122994 greatly simplifies the same function, I've restricted my fixes to just those that would exist if that patch landed before this one. I also believe refineIndexType contains a bug although not necessarily one we can realistically hit so am leaving that for a follow-on patch.

Matt added a subscriber: Matt.Apr 7 2022, 12:05 PM
This revision is now accepted and ready to land.Apr 28 2022, 4:06 AM
This revision was landed with ongoing or failed builds.Apr 29 2022, 4:43 AM
This revision was automatically updated to reflect the committed changes.