Live values detection in LLVM

Hi all,

At some points of my program, I would like to know if some LLVM values are live or not. For that, I'm using the LiveValues pass, which gives me methods such as :

isLiveThroughBlock(Value * v, BasicBlock * b)
isKilledInBlock(Value * v, BasicBlock * b)

* If I understand well the code, dominator trees are used to compute the LiveThrough blocks.
The definition of dominator in graph theory is the following:
"A node <http://en.wikipedia.org/wiki/Node_(computer_science)&gt; d /dominates/ a node n if every path from the /start node/ to n must go through d."

Then, that means in some cases, the method isLiveThroughBlock is going to answer false, whereas the right answer is true. Is it right ?

* To compute the set of blocks where isKilledInBlock is true, we compute the smallest loop containing both the definition of the variable and all its use, and isKilledInBlock becomes true in all ExitingBlock of this loop.
An exiting block is a block inside the loop that have successors outside of the loop.
So, even if isKilledInBlock(v,b)=true, that doesn't mean the value can't be used anymore: if the exiting block has a successor in the loop, then the value will be used again.

Do I understand well ? If yes, how is it possible to say for sure that a value isn't used any more ?

Thanks for your help

J. Henry

[ Note: I'm working with Julien, we talked about the issue off-list ]

Julien Henry <Julien.Henry@imag.fr> writes:

Hi all,

At some points of my program, I would like to know if some LLVM values
are live or not. For that, I'm using the LiveValues pass, which gives me
methods such as :

isLiveThroughBlock(Value * v, BasicBlock * b)
isKilledInBlock(Value * v, BasicBlock * b)

This pass has just been removed in the trunk LLVM:

commit 11ae8292f73d31a3740097cc446a789ca13cdd7f
Author: Dan Gohman <gohman@apple.com>

    Delete the LiveValues pass. I won't get get back to the project it
    was started for in the foreseeable future.
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126668 91177308-0d34-0410-b5e6-96231b3b80d8

You should probably look at LiveVariables (yes, "Variables", not
"Values") instead:

  http://llvm.org/docs/doxygen/html/LiveVariables_8h_source.html