This is an archive of the discontinued LLVM Phabricator instance.

[llvm][SVE] Remove redundant and when comparing against extending load
ClosedPublic

Authored by DavidTruby on Jul 7 2022, 5:48 AM.

Details

Summary

When determining if an and should be merged into an extending load
the constant argument to the and is currently not checked if the
argument requires truncation. This prevents the combine happening when
the vector width is half the normal available vector width for SVE VLA
vectors.

Diff Detail

Event Timeline

DavidTruby created this revision.Jul 7 2022, 5:48 AM
Herald added a project: Restricted Project. · View Herald Transcript
DavidTruby requested review of this revision.Jul 7 2022, 5:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2022, 5:48 AM
DavidTruby added a comment.EditedJul 7 2022, 5:54 AM

Since there were no tests triggering this before, here's a compiler explorer link showing what codegen looks like at the moment for comparison: https://godbolt.org/z/3f8Wh5c5x

I've added more tests than just the one that gets triggered here as more of these have the same issue on llvm 14 so that should also be defended against regressions.

Matt added a subscriber: Matt.Jul 7 2022, 3:53 PM
c-rhodes accepted this revision.Jul 8 2022, 3:16 AM

LGTM

This revision is now accepted and ready to land.Jul 8 2022, 3:16 AM
This revision was landed with ongoing or failed builds.Jul 19 2022, 9:08 AM
This revision was automatically updated to reflect the committed changes.