This is an archive of the discontinued LLVM Phabricator instance.

[LoopUnroll] Forget block and loop dispositions during unrolling.
ClosedPublic

Authored by fhahn on Sep 25 2022, 1:12 PM.

Details

Summary

After unrolling a loop, the block and loop dispositions need to be
cleared. As we don't know which SCEVs in the loop/blocks may be
impacted, completely clear the cache. This should also fix some cases
where deleted loops remained in the LoopDispositions cache.

This fixes a verification failure surfaced by D134531.

I am planning on reviewing/updating the existing uses of
forgetLoopDispositions to check if they should be replaced by
forgetBlockAndLoopDispositions.

Diff Detail

Event Timeline

fhahn created this revision.Sep 25 2022, 1:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 25 2022, 1:12 PM
fhahn requested review of this revision.Sep 25 2022, 1:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 25 2022, 1:12 PM
fhahn updated this revision to Diff 462759.Sep 25 2022, 1:14 PM

Fix formatting.

mkazantsev added inline comments.Sep 26 2022, 2:38 AM
llvm/lib/Transforms/Utils/LoopUnroll.cpp
470

Doesn't forgetAllLoops already do it? I guess this should be under else clause.

fhahn updated this revision to Diff 462851.Sep 26 2022, 3:18 AM
fhahn marked an inline comment as done.

Move SE->forgetBlockAndLoopDispositions() into else {} clause, thanks!

llvm/lib/Transforms/Utils/LoopUnroll.cpp
470

Done, thanks!

nikic accepted this revision.Sep 26 2022, 6:18 AM

LGTM

This revision is now accepted and ready to land.Sep 26 2022, 6:18 AM
fhahn updated this revision to Diff 463125.Sep 27 2022, 12:46 AM

Rebase on current main.

This revision was landed with ongoing or failed builds.Sep 27 2022, 12:49 AM
This revision was automatically updated to reflect the committed changes.