[LVI] Constant-propagate a zero extension of the switch condition value through…

Description

[LVI] Constant-propagate a zero extension of the switch condition value through case edges

Summary:
LazyValueInfo currently computes the constant value of the switch condition through case edges, which allows the constant value to be propagated through the case edges.

But we have seen a case where a zero-extended value of the switch condition is used past case edges for which the constant propagation doesn't occur.

This patch adds a small logic to handle such a case in getEdgeValueLocal().

This is motivated by the Python 2.7 eval loop in PyEval_EvalFrameEx() where the lack of the constant propagation causes longer live ranges and more spill code than necessary.

With this patch, we see that the code size of PyEval_EvalFrameEx() decreases by ~5.4% and a performance test improves by ~4.6%.

Reviewers: wmi, dberlin, sanjoy

Reviewed By: sanjoy

Subscribers: davide, davidxl, llvm-commits

Differential Revision: https://reviews.llvm.org/D34822

Details

Committed
yamauchiJul 28 2017, 11:35 AM
Reviewer
sanjoy
Differential Revision
D34822: [LVI] Constant-propagate a zero extension of the switch condition value through case edges
Parents
rL309414: Simplify path_has_no_database_type
Branches
Unknown
Tags
Unknown