This is an archive of the discontinued LLVM Phabricator instance.

[LoadStoreVectorizer] Make aliasing check more precise
ClosedPublic

Authored by nikic on Aug 31 2021, 1:30 PM.

Details

Summary

The load store vectorizer currently uses isNoAlias to determine whether memory-accessing instructions should prevent vectorization. However, this only works for loads and stores. Additionally, a couple of intrinsics like assume are special-cased to be ignored.

Instead use getModRefInfo() to generically determine whether the instruction accesses/modifies the relevant location. This will automatically handle all inaccessiblememonly intrinsics correctly (as well as other calls that don't modref for other reasons). This requires generalizing the code a bit, as it was previously only considering loads and stored in particular.

Diff Detail

Event Timeline

nikic created this revision.Aug 31 2021, 1:30 PM
nikic requested review of this revision.Aug 31 2021, 1:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2021, 1:30 PM
nikic updated this revision to Diff 369782.Aug 31 2021, 1:32 PM

Remove spurious test diff.

arsenm accepted this revision.Aug 31 2021, 2:51 PM
This revision is now accepted and ready to land.Aug 31 2021, 2:51 PM
This revision was automatically updated to reflect the committed changes.