LLVM Value Tracking Analysis

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 ?

Thanks

Xin

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.

Ciao, Duncan.

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 ? 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.

Thanks

Xin

Hi Xin,

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.