[LLVMdev] LLVM Value Tracking Analysis

Duncan Sands baldrick at free.fr
Fri Mar 9 10:41:44 PST 2012


Hi Xin,

On 04/03/12 00:57, Xin Tong wrote:
> On Sat, Mar 3, 2012 at 5:26 PM, Duncan Sands<baldrick at free.fr>  wrote:
>> Hi Xin,
>>
>>> It seems to me that LLVM does not do too much on value range analysis.
>>>    i.e. what are the value constraints on a variable at a given point in
>>> the program. The closest thing i can find is the ValueTracking API,
>>> which can do some simple analysis on the value of a variables. Am I
>>> missing something/Is there a plan on the implementation of a more
>>> powerful value range analysis ?
>>
>> as far as I know there have been two implementations of this kind of thing
>> in the past, but they were each removed in turn.  IIRC, this was due to them
>> significantly increasing compilation time without a sufficient improvement in
>> the quality of code to justify the compile time cost.  Currently the closest
>> thing is the correlated value propagation pass, but I doubt it will be useful
>> for
>> you.
>
> The correlated value propagation pass is what is currently in the
> ValueTrack.cpp file ?

no, it is in lib/Transforms/Scalar/CorrelatedValuePropagation.cpp.  But the
analysis it uses, that you might want to use, is LazyValueInfo, see
include/llvm/Analysis/LazyValueInfo.h

  do you know when the two implementations are
> removed ? and where i can get them ? and how difficult is it to bring
> them up to the current src tree.

The original was called predsimplify and was removed in LLVM 2.7.  The other
was based on the ABCD algorithm and SSI and was removed in 2.8.

Ciao, Duncan.



More information about the llvm-dev mailing list