<div dir="ltr"><span class="Apple-style-span" style="font-style: italic;">" All of these answers are things you would do for an individual LLVM "Value".  "</span><div><span class="Apple-style-span" style="font-style: italic;"><br>
</span></div><div><span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="font-style: normal;">I am sorry, but may be i am missing something here.</span></span></div><div><span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="font-style: normal;">In the previous email you suggested the function "</span><span class="Apple-style-span" style="border-collapse: collapse; font-style: normal; ">bool isLiveOut(Instruction* I) ".</span></span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse;">So, if you please, explain how i can find out if a <span class="Apple-style-span" style="font-weight: bold;">llvm::Value</span> (not an llvm::Instruction) is live out or not.</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse;">As i understand it, isLiveOut can help me ONLY if i have an llvm::Instruction (not a llvm:Value).</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">Thanks.</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">P.S</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse;">I am truly grateful for your help.   </span></div><div><span class="Apple-style-span" style="font-style: italic;"><span class="Apple-style-span" style="border-collapse: collapse; font-style: normal;"><br>
</span></span><br><div class="gmail_quote">On Sat, May 30, 2009 at 10:32 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div><div class="im"><div>On May 30, 2009, at 5:03 AM, Rotem Varon wrote:</div><blockquote type="cite"><div dir="ltr">Is it possible to determine the liveout of the operands (see example bellow) ?<br>
<br>        %5 = add i32 %4, %3    <br><br>For '%5': i can simply use " i->isUsedOutsideOfBlock() "<br>
For '%3' and '%4' : this is the question ...<br></div></blockquote><div><br></div></div><div>By definition, operands are live out if they're used in any block that's reachable from</div><div>the block containing the instruction.  Barring a few special cases we've already</div>
<div>covered, the easiest way I know to compute that in general is to first calculate the</div><div>set of reachable blocks, then iterate through the uses, checking whether that use</div><div>is in a reachable block (if the use is in a PHI node, only count it if the</div>
<div>corresponding incoming block is reachable).</div><div><br></div></div><div><div class="im"><blockquote type="cite"><div dir="ltr">From your answer, is it possible to determine <b>which</b> value is liveout ( in binary instruction)?<br>
</div></blockquote><div><br></div></div>All of these answers are things you would do for an individual LLVM "Value".  I don't</div><div>know what you mean by "which value" beyond that, and I don't know what you mean</div>
<div>by "in binary instruction".</div><div><br></div><font color="#888888"><div>John.</div></font></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div></div>