Recommit r328307: [IPSCCP] Use constant range information for comparisons of parameters.
authorFlorian Hahn <florian.hahn@arm.com>
Mon, 2 Jul 2018 12:44:04 +0000 (12:44 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Mon, 2 Jul 2018 12:44:04 +0000 (12:44 +0000)
commit4ebba909a209b93c1f0cb626412aa2687c0fb36d
treeb2ae6d89b96b5b29c300caa49097540cb68677f6
parenta2d9c2be3f8051b795efc4d544c231840181d812
Recommit r328307: [IPSCCP] Use constant range information for comparisons of parameters.

This version contains a fix to add values for which the state in ParamState change
to the worklist if the state in ValueState did not change. To avoid adding the
same value multiple times, mergeInValue returns true, if it added the value to
the worklist. The value is added to the worklist depending on its state in
ValueState.

Original message:
For comparisons with parameters, we can use the ParamState lattice
elements which also provide constant range information. This improves
the code for PR33253 further and gets us closer to use
ValueLatticeElement for all values.

Also, as we are using the range information in the solver directly, we
do not need tryToReplaceWithConstantRange afterwards anymore.

Reviewers: dberlin, mssimpso, davide, efriedma

Reviewed By: mssimpso

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

llvm-svn: 336098
llvm/lib/Transforms/Scalar/SCCP.cpp
llvm/test/Transforms/SCCP/ip-constant-ranges.ll