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():
- getValueOnEdge(): As this is where the intersection is moved, no change in behavior there.
- solveBlockValueNonLocal(): This call is done without the context instruction.
- 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.)