This is an archive of the discontinued LLVM Phabricator instance.

[CVP] [LVI] Add LVI::getPredicateInBlock and use it in CVP.
Needs RevisionPublic

Authored by jlebar on Mar 8 2018, 6:01 AM.

Details

Summary

LVI::getPredicateInBlock is like LVI::getPredicateAt, but uses the more
powerful getValueInBlock API, instead of getValueAt. This lets it solve
things like x & y < z.

This came out of a discussion in D44102, in which sanjoy@ realized that
getConstantRange, which calls getValueInBlock, was more powerful than
getPredicateAt, which calls getValueAt.

Event Timeline

jlebar created this revision.Mar 8 2018, 6:01 AM
reames requested changes to this revision.Feb 4 2019, 3:50 PM

Sorry for just getting around to reviewing this now. Should be a bit more response now.

Looking at the approach, it appears you're effectively working around a implementation limitation in getPredicateAt. As an alternative, why not simply extend getPredicateAt to compute facts known at the begining of the block specified by the context pointer, and then merge that with the facts from within the block?

This revision now requires changes to proceed.Feb 4 2019, 3:50 PM
davide removed a subscriber: davide.Feb 4 2019, 3:53 PM
fhahn added a subscriber: fhahn.Feb 6 2019, 6:49 AM
sanjoy resigned from this revision.Jan 29 2022, 5:43 PM
sanjoy added inline comments.
llvm/include/llvm/Analysis/LazyValueInfo.h
84

Can we pick the block from CxtI?

Herald added a project: Restricted Project. · View Herald TranscriptJan 29 2022, 5:43 PM