This is an archive of the discontinued LLVM Phabricator instance.

[LVI] Move assume intersection from getEdgeValue() to getValueOnEdge()
Needs ReviewPublic

Authored by nikic on Mar 28 2020, 7:25 AM.

Details

Reviewers
reames
fhahn
Summary

We currently perform an assume intersection with the context instruction directly in the internal getEdgeValue() API. This patch moves it into getValueOnEdge(), similar to what we do in getValueInBlock() and getValueAt().

There are three users of getEdgeValue():

  1. getValueOnEdge(): As this is where the intersection is moved, no change in behavior there.
  2. solveBlockValueNonLocal(): This call is done without the context instruction.
  3. solveBlockValuePHINode(): This call is done with the phi node as context, i.e. the start of the basic block. We already intersect with the terminators of the predecessors, so this doesn't add anything.

Moving the intersection in this way avoids unnecessary work, makes the LVI APIs more symmetric, and makes the caching more obviously correct (as the lengthy comments that are being removed here indicate.)

Diff Detail

Event Timeline

nikic created this revision.Mar 28 2020, 7:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 28 2020, 7:25 AM
lebedev.ri resigned from this revision.Apr 8 2020, 11:46 PM

No idea who is comfortable/qualified doing LVI reviews, but that isn't me.

nikic edited reviewers, added: fhahn; removed: lebedev.ri.Apr 26 2020, 1:13 AM