This is an archive of the discontinued LLVM Phabricator instance.

[IndVars][NFC] Remove redundant param in optimizeLoopExitWithUnknownExitCount
ClosedPublic

Authored by mkazantsev on Dec 12 2022, 1:02 AM.

Details

Summary

There was a crippled version of this transform for Inverted predicate, so the same
query was done twice. Advanced version of this transform wasn't implemented for
inverted condition. Thus, the code was hard to read. The only real purpose of the
Inverted param was to make a simple isKnownPredicateAt query.

Instead if this, use evaluatePredicateAt to solve the task for both inverted and
non-inverted predicate. This slightly changes the order of queries, but effectively
it should save some time by avoiding duplicating queries, and simplifies the code a lot.

I also could not find any evidence that we ever eliminate anything with Inverted = true,
but conservatively preserved the current behavior. Maybe we can remove it and save
some compile time.

Diff Detail

Event Timeline

mkazantsev created this revision.Dec 12 2022, 1:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 12 2022, 1:02 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
mkazantsev requested review of this revision.Dec 12 2022, 1:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 12 2022, 1:02 AM
mkazantsev edited the summary of this revision. (Show Details)Dec 12 2022, 1:02 AM
nikic accepted this revision.Dec 12 2022, 1:14 AM

LGTM

This revision is now accepted and ready to land.Dec 12 2022, 1:14 AM
This revision was landed with ongoing or failed builds.Dec 12 2022, 1:28 AM
This revision was automatically updated to reflect the committed changes.