This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Treat MVE gather add-like-or's like adds
ClosedPublic

Authored by dmgreen on Nov 1 2021, 4:35 AM.

Details

Summary

LLVM has the habit of turning adds with no common bits set into ors, which means we need to detect them and treat them like adds again in the MVE gather/scatter lowering pass.

Diff Detail

Event Timeline

dmgreen created this revision.Nov 1 2021, 4:35 AM
dmgreen requested review of this revision.Nov 1 2021, 4:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 1 2021, 4:35 AM
samtebbs accepted this revision.Nov 2 2021, 3:20 AM

LGTM with a couple of comments.

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

Without context, I think this function name reads as "add like an or", rather than "add-like or". I think it would be good to add a comment above it or rename it to isOrLikeAnAdd to emphasise that it's an or that is add-like.

1080

Does this need to check if the OR is add-like?

This revision is now accepted and ready to land.Nov 2 2021, 3:20 AM
dmgreen added inline comments.Nov 2 2021, 3:28 AM
llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
364

Will do. I got the name from some similar functions in the arm tablegen backend, but adding a comment sounds good.

1080

This one is fine (I'm pretty sure), because we have already checked the type above.

This revision was landed with ongoing or failed builds.Nov 3 2021, 4:41 AM
This revision was automatically updated to reflect the committed changes.