[LLVMdev] Value liveout (uses)

Rotem Varon varonrotem at gmail.com
Sun May 31 10:46:34 PDT 2009


" All of these answers are things you would do for an individual LLVM
"Value".  "
I am sorry, but may be i am missing something here.
In the previous email you suggested the function "bool
isLiveOut(Instruction* I) ".
So, if you please, explain how i can find out if a llvm::Value (not an
llvm::Instruction) is live out or not.
As i understand it, isLiveOut can help me ONLY if i have an
llvm::Instruction (not a llvm:Value).

Thanks.

P.S
I am truly grateful for your help.


On Sat, May 30, 2009 at 10:32 PM, John McCall <rjmccall at apple.com> wrote:

> On May 30, 2009, at 5:03 AM, Rotem Varon wrote:
>
> Is it possible to determine the liveout of the operands (see example
> bellow) ?
>
>         %5 = add i32 %4, %3
>
> For '%5': i can simply use " i->isUsedOutsideOfBlock() "
> For '%3' and '%4' : this is the question ...
>
>
> By definition, operands are live out if they're used in any block
> that's reachable from
> the block containing the instruction.  Barring a few special cases we've
> already
> covered, the easiest way I know to compute that in general is
> to first calculate the
> set of reachable blocks, then iterate through the uses, checking whether
> that use
> is in a reachable block (if the use is in a PHI node, only count it if the
> corresponding incoming block is reachable).
>
> From your answer, is it possible to determine *which* value is liveout (
> in binary instruction)?
>
>
> All of these answers are things you would do for an individual LLVM
> "Value".  I don't
> know what you mean by "which value" beyond that, and I don't know what you
> mean
> by "in binary instruction".
>
> John.
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090531/52e5c72c/attachment.html>


More information about the llvm-dev mailing list