[LLVMdev] Value liveout (uses)

John McCall rjmccall at apple.com
Sun May 31 11:54:13 PDT 2009


On May 31, 2009, at 10:46 AM, Rotem Varon wrote:
> " 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).

Yes, sorry, I used the term Value in response to your question about  
"specific value[s]".
These are operations that only make sense for Instructions, not  
arbitrary values, which
don't really have liveness in any real sense.

> Do i need to set the "LiveValues" pass in the PassManager as a  
> prerequisite? if so how do i get the results ?
> Can i simply use its public function ?
> Can you explain what exactly do mean by "conservative  
> approximations" ? Can it determine the live out of llvm:Value  
> accurately?

I don't know much about the pass in question, but a conservative  
approximation means
that it will sometimes claim that a value is live when it isn't, but  
not the other way around.
For most uses of liveness, that's good enough to guarantee correctness  
and still get
some useful optimization opportunities without making the entire pass  
excessively
expensive to run.

John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090531/052da46e/attachment.html>


More information about the llvm-dev mailing list