<div dir="ltr">Hi,<div><br></div><div>Do i need to set the "LiveValues" pass in the PassManager as a prerequisite? if so how do i get the results ?</div><div>Can i simply use its public function ? </div><div>Can you explain what exactly do mean by "<span class="Apple-style-span" style="border-collapse: collapse; ">conservative approximations" ? Can it determine the live out of llvm:Value accurately?</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;">Thank you very much.</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span><br><div class="gmail_quote">On Sun, May 31, 2009 at 7:19 PM, Dan Gohman <span dir="ltr"><<a href="mailto:gohman@apple.com">gohman@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
The pass you're referring to is in include/llvm/Analysis/LiveValues.h<br>
and lib/Analysis/LiveValues.cpp. It computes conservative<br>
approximations for specific liveness queries, rather than full<br>
livein/liveout information. It's intended to be used as a heuristic.<br>
<font color="#888888"><br>
Dan<br>
</font><div><div></div><div class="h5"><br>
On May 30, 2009, at 3:51 PM, Evan Cheng wrote:<br>
<br>
> I believe Dan has added a pass to compute livein / liveout values.<br>
><br>
> Evan<br>
><br>
> Sent from my iPhone<br>
><br>
> On May 30, 2009, at 5:03 AM, Rotem Varon <<a href="mailto:varonrotem@gmail.com">varonrotem@gmail.com</a>> wrote:<br>
><br>
>> Thank you.<br>
>><br>
>> Is it possible to determine the liveout of the operands (see<br>
>> 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>
>><br>
>> From your answer, is it possible to determine which value is<br>
>> liveout ( in binary instruction)?<br>
>><br>
>><br>
>> On Sat, May 30, 2009 at 2:57 AM, John McCall <<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>><br>
>> wrote:<br>
>> On May 29, 2009, at 11:37 PM, Rotem Varon wrote:<br>
>> > How can i know, if a value have uses outside of the current basic<br>
>> > block (liveout), without iterating through all the basic block ?<br>
>><br>
>> If the value is created within the basic block in question, and the<br>
>> block doesn't loop to itself, then you can just iterate through the<br>
>> uses and note if the use is an instruction in a different block:<br>
>><br>
>> bool isLiveOut(Instruction* I) {<br>
>>        BasicBlock* I_BB = I->getParent():<br>
>>        for (Value::use_iterator ui = I->use_begin(), ue = I-<br>
>> >use_end(); ui !<br>
>> = ue; ++ui)<br>
>>                if (cast<Instruction>(ui)->getParent() != I_BB)<br>
>>                        return true;<br>
>>        }<br>
>> }<br>
>><br>
>> If the value is created within the block but the block loops to<br>
>> itself, you can get away with a very slight adjustment:<br>
>><br>
>>                if (cast<Instruction>(ui)->getParent() != I_BB && !<br>
>> isa<PHINode>(ui))<br>
>><br>
>> If the value is created in one block and you want to know if it's<br>
>> live<br>
>> out of some dominated block, that's a lot more complicated (and<br>
>> expensive).<br>
>><br>
>> John.<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>
>> _______________________________________________<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>
_______________________________________________<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>
</div></div></blockquote></div><br></div></div>