This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Verify contents of loop disposition cache
ClosedPublic

Authored by mkazantsev on Sep 18 2022, 10:56 PM.

Details

Summary

It seems that it is sometimes broken. Initial motivation for this was
investigation of https://github.com/llvm/llvm-project/issues/56260, but
it also seems that we have found an unrelated bug in LoopFusion that leaves
broken caches.

Diff Detail

Event Timeline

mkazantsev created this revision.Sep 18 2022, 10:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 18 2022, 10:56 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
mkazantsev requested review of this revision.Sep 18 2022, 10:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 18 2022, 10:56 PM
nikic added inline comments.Sep 19 2022, 12:50 AM
llvm/lib/Analysis/ScalarEvolution.cpp
13991

Why does this not use the usual approach of comparing with the loop disposition on the other ScalarEvolution instance (SE2)?

mkazantsev added inline comments.Sep 19 2022, 2:40 AM
llvm/lib/Analysis/ScalarEvolution.cpp
13991

I was hesitant about this because SE2 might also have wrong cache state (for same reasons). On other hand we might invalidate it all the time... Let's see if it works.

mkazantsev added inline comments.Sep 19 2022, 2:47 AM
llvm/lib/Analysis/ScalarEvolution.cpp
13991

Ok, if we believe that only transform passes may break this, then it's fine.

Changed to SE2 comparison as Nikita has suggested.

nikic accepted this revision.Sep 19 2022, 3:13 AM

LGTM

llvm/lib/Analysis/ScalarEvolution.cpp
13992

disposition

This revision is now accepted and ready to land.Sep 19 2022, 3:13 AM
This revision was automatically updated to reflect the committed changes.
fhahn added a comment.Sep 19 2022, 4:01 AM

Thanks for extending the verifier, LGTM!

@mkazantsev Please can you take a look at the build failures on EXPENSIVE_CHECKS builds? https://lab.llvm.org/buildbot/#/builders/104/builds/9004