llvm-project/llvm/test/Transforms/CorrelatedValuePropagation
Hiroshi Yamauchi 144ee2b4d7 [LVI] Constant-propagate a zero extension of the switch condition value through case edges
Summary:
(This is a second attempt as https://reviews.llvm.org/D34822 was reverted.)

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: sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

llvm-svn: 309986
2017-08-03 21:11:30 +00:00
..
2010-09-02-Trunc.ll
2010-09-26-MergeConstantRange.ll
add.ll [LVI] Teach LVI to reason about ORs of icmps similar to how it reasons about ANDs of icmps 2017-06-23 01:08:16 +00:00
alloca.ll Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
ashr.ll [CVP] Convert an AShr to a LShr if 1st operand is known to be nonnegative. 2016-10-12 13:41:38 +00:00
basic.ll [IR] Make SwitchInst::CaseIt almost a normal iterator. 2017-03-26 02:49:23 +00:00
conflict.ll Revert @llvm.assume with operator bundles (r289755-r289757) 2016-12-19 08:22:17 +00:00
crash.ll [LVI] Fix potential memory corruption in getValueFromCondition 2016-08-12 15:08:15 +00:00
guards.ll [LVI] Fix a bug with a guard being the very first instruction in a BB not taken into account 2016-10-21 15:02:21 +00:00
icmp.ll
non-null.ll
range.ll [LVI] Constant-propagate a zero extension of the switch condition value through case edges 2017-08-03 21:11:30 +00:00
sdiv.ll
select.ll
srem.ll