This is an archive of the discontinued LLVM Phabricator instance.

[LoopRotate] Drop loop dispositions when rotating loops. PR56260
ClosedPublic

Authored by mkazantsev on Sep 19 2022, 1:08 AM.

Details

Summary

This is required because if there is a pure loop-invariant instruction, Loop Rotation
may decide to not clone it and just hoist it instead. If SCEV has previously cached
that it was loop-variant (not being smart enough to prove invariance), we may end
up with inconsistent cache state (which may later trigger false-negative assertion
failures checking that something was invariant).

This is a conservative fix that unconditionally drops the dispositions. We could
only drop it if the hoisting has actually happened, but it should take some time
understanding whether it's safe with all other things this function does.

Diff Detail

Event Timeline

mkazantsev created this revision.Sep 19 2022, 1:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2022, 1:08 AM
mkazantsev requested review of this revision.Sep 19 2022, 1:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2022, 1:08 AM
mkazantsev retitled this revision from [LoopRotate] Drop loop dispositions when rotationg loops. PR56260 to [LoopRotate] Drop loop dispositions when rotating loops. PR56260.Sep 19 2022, 1:11 AM
fhahn accepted this revision.Sep 19 2022, 3:32 AM

LGTM, thanks. As mentioned in D134173, it would be good to adjust the API to make this harder to miss.

This revision is now accepted and ready to land.Sep 19 2022, 3:32 AM