This is an archive of the discontinued LLVM Phabricator instance.

[SCEV][NFC][CT] Do not waste time proving contextual facts for unreached loops and blocks
ClosedPublic

Authored by mkazantsev on Jul 15 2022, 9:44 AM.

Details

Summary

In fact, in unreached code we can say that every fact is true. So do not waste time trying to
do something smarter.

Formally it's not an NFC because it may change query results in unreached code, but they
won't have any impact on execution.

Diff Detail

Event Timeline

mkazantsev created this revision.Jul 15 2022, 9:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2022, 9:44 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
mkazantsev requested review of this revision.Jul 15 2022, 9:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2022, 9:44 AM

Nikita, could you pls run CT machinery and check if we win any CT from it?

nikic added a comment.Jul 18 2022, 5:55 AM

Not seeing a difference either way from this patch. I don't think that unreachable blocks are common enough to have any meaningful impact on compile-time.

llvm/lib/Analysis/ScalarEvolution.cpp
11015–11018

unreached -> unreachable

This revision was not accepted when it landed; it landed in state Needs Review.Jul 20 2022, 5:03 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.