[PATCH] D36247: [LVI] Constant-propagate a zero extension of the switch condition value through case edges
Hiroshi Yamauchi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 2 15:52:14 PDT 2017
yamauchi created this revision.
(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%.
https://reviews.llvm.org/D36247
Files:
lib/Analysis/LazyValueInfo.cpp
test/Transforms/CorrelatedValuePropagation/range.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36247.109446.patch
Type: text/x-patch
Size: 9257 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170802/3cf043f1/attachment.bin>
More information about the llvm-commits
mailing list