This is an archive of the discontinued LLVM Phabricator instance.

[LoopIdiom] Fix bailout for aliasing in memcpy transform.
ClosedPublic

Authored by efriedma on May 26 2022, 9:46 AM.

Details

Summary

Commit dd5991cc modified the aliasing checks here to allow transforming a memcpy where the source and destination point into the same object. However, the change accidentally made the code skip the alias check for other operations in the loop.

Instead of completely skipping the alias check, just skip the check for whether the memcpy aliases itself.

Diff Detail

Event Timeline

efriedma created this revision.May 26 2022, 9:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2022, 9:46 AM
efriedma requested review of this revision.May 26 2022, 9:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2022, 9:46 AM
yurai007 accepted this revision.May 31 2022, 4:40 AM

Thanks for fixing such nasty bug. Now checking whether loop access load is not only correct but also more straightforward. Maybe it would be good to receive more comments from others but since I cannot find anything wrong with this change, it's LGTM.

This revision is now accepted and ready to land.May 31 2022, 4:40 AM
This revision was landed with ongoing or failed builds.May 31 2022, 5:24 PM
This revision was automatically updated to reflect the committed changes.