[LLVMdev] value tracking
Nuno Lopes
nunoplopes at sapo.pt
Mon Jan 19 15:54:48 PST 2009
Hi,
I've been thinking about a (potentially lazy) value tracking analysis that
could be reused by several optimization passes. I don't know if it exists in
llvm or not, but to my better knowledge it does not. ok there exists the
ValueTracking class, but it does not provide a function like e.g.
MayHaveTheValue(Value* v, APSInt x) to check if a given var v may ever have
the value x
My proposal:
- create a value tracking analysis interface that can provide extensive
info about vars (e.g. the set of possible values for a given vars, etc..)
- implement that interface in several ways with different tradeoffs of
preciseness vs speed (e.g. range analysis, value set tracking, path
sensitive or not, interprocedural, etc..)
I believe this could reuse some code from PredSimplify and hopefully make it
a very simple pass (as much of the work would then be hidden in the value
tracking analysis).
Having this sort of readily available analysis would allow us to build other
optimization more easily. I've already a few ideas in mind (I've implemented
one of them, but I had to unnecessarily implement too much of this value
tracking logic).
Any ideas, opinions, etc..?
Regards,
Nuno
More information about the llvm-dev
mailing list