This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Use defining scope to bound backwards predicate search [mostly-nfc]
AbandonedPublic

Authored by reames on Oct 15 2021, 11:33 AM.

Details

Reviewers
mkazantsev
nikic
Summary

The basic idea here is that if we have an expression, we can't find a predicate which proves facts about that expression outside the region in which that expression is defined. We can find facts about sub-expressions, but the current logic doesn't let us leverage those. (Note that applyLoopGuards does build facts about sub-expressions and then lazily apply them, so we can't do the same there. In theory at least.)

The one exception is that a trivially unreachable block currently implies all conditions and we loose that. I'm honestly not sure how interesting that is given simplify-cfg and friends will rip the code away wholesale.

The motivation here is to improve compile time. @nikic Do you see any positive impact from this? If not, I'll abandon as the complexity is not worth it on it's own.

Diff Detail

Event Timeline

reames created this revision.Oct 15 2021, 11:33 AM
reames requested review of this revision.Oct 15 2021, 11:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 15 2021, 11:33 AM

CT boost is cool, but the regressions are concerning. Any plans to fix them?

llvm/lib/Analysis/ScalarEvolution.cpp
13715

nit

reames abandoned this revision.Oct 18 2021, 12:17 PM

Abandoning as there was unexpected code size regressions from this patch. In abstract, it would be worth understanding why as the CT wins are interesting, but I'm not going to have time to get to that in the nearish future. Will reopen the review if that changes at any time.