This is an archive of the discontinued LLVM Phabricator instance.

[LoopLoadElim] Filter away candidates that stop being AddRecs after loop versioning. PR47457
ClosedPublic

Authored by mkazantsev on Sep 9 2020, 2:19 AM.

Details

Summary

The test in PR47457 demonstrates a situation when candidate load's pointer's SCEV
is no loger a SCEVAddRec after loop versioning. The code there assumes that it is
always a SCEVAddRec and crashes otherwise.

This patch makes sure that we do not consider candidates for which this requirement
is broken after the versioning.

Diff Detail

Event Timeline

mkazantsev created this revision.Sep 9 2020, 2:19 AM
mkazantsev requested review of this revision.Sep 9 2020, 2:19 AM
mkazantsev updated this revision to Diff 290677.Sep 9 2020, 2:21 AM
mkazantsev updated this revision to Diff 290679.Sep 9 2020, 2:48 AM
asbirlea accepted this revision.Sep 9 2020, 11:36 AM
asbirlea added inline comments.
llvm/test/Transforms/LoopLoadElim/pr47457.ll
3

Readd "; REQUIRES: asserts"

This revision is now accepted and ready to land.Sep 9 2020, 11:36 AM
mkazantsev marked an inline comment as done.Sep 9 2020, 10:20 PM
mkazantsev added inline comments.
llvm/test/Transforms/LoopLoadElim/pr47457.ll
3

Ok, thanks!

mkazantsev marked an inline comment as done.Sep 9 2020, 10:21 PM