<div dir="ltr"><div class="gmail_default" style="font-size:small">"<span style="font-size:12.8px">I was under the impression that you want to know which register is live at a specific point (an instruction).</span>" This is exactly what I'm looking for. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Sorry for the misunderstanding. After double checking I found that LivePhysReg does consider the arguments and the return value of a function. So both of them work for my purpose. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks again. </div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Regards,<div>Hu Hong</div></div></div></div>
<br><div class="gmail_quote">On 21 January 2017 at 18:23, Nemanja Ivanovic <span dir="ltr"><<a href="mailto:nemanja.i.ibm@gmail.com" target="_blank">nemanja.i.ibm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I just realized that I forgot to mention where you can get the info about a physical register unused in the function (if that's what you're after):<br>MachineRegisterInfo::<wbr>isConstantPhysReg()<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 21, 2017 at 11:17 AM, Nemanja Ivanovic <span dir="ltr"><<a href="mailto:nemanja.i.ibm@gmail.com" target="_blank">nemanja.i.ibm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>I'm not sure exactly what you're after.<br></div>I was under the impression that you want to know which register is live at a specific point (an instruction). If that's the case, how do one of the two suggested solutions not suffice?<br>If a register is live-in to a block and not killed before your instruction or it has a def and no kill within the block, it is live. Otherwise it is dead and available. Isn't it?<br></div>Or are you interested in whether a physical register is unused in the entire function?<br></div><div class="m_-355166172738506718HOEnZb"><div class="m_-355166172738506718h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 21, 2017 at 10:21 AM, Hong Hu <span dir="ltr"><<a href="mailto:huhong789@gmail.com" target="_blank">huhong789@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-size:small">Hi Nemanja and Matthias,</div><div style="font-size:small"><br></div><div style="font-size:small">Thanks for the reply. </div><div style="font-size:small"><br></div><div style="font-size:small">I checked both Register Scavenger and LivePhysReg. It seems that both work on the BasicBlock level, right? </div><div style="font-size:small"><br></div><div style="font-size:small">Is it possible to perform such analysis in a whole function? For example, considering the calling convention (where the rsi, rdi will be in use from the beginning) and the return convention (where rax will be in use in the last bb).</div><div class="gmail_extra"><br clear="all"><div><div class="m_-355166172738506718m_1648218633823925671m_-3948889503114184922gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Regards,<div>Hu Hong</div></div></div></div>
<br><div class="gmail_quote">On 20 January 2017 at 03:55, Matthias Braun <span dir="ltr"><<a href="mailto:mbraun@apple.com" target="_blank">mbraun@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>There is also the LivePhysReg facility that I would recomment if you just want to query for a free register and do not need the full feature set of the RegisterScavenger.</div><span class="m_-355166172738506718m_1648218633823925671m_-3948889503114184922HOEnZb"><font color="#888888"><div><br></div><div>- Matthias</div></font></span><div><div class="m_-355166172738506718m_1648218633823925671m_-3948889503114184922h5"><br><div><blockquote type="cite"><div>On Jan 19, 2017, at 5:50 AM, Nemanja Ivanovic via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_-355166172738506718m_1648218633823925671m_-3948889503114184922m_1628503878704883635Apple-interchange-newline"><div><div dir="ltr"><div>I believe what you're after is the register scavenger.<br></div><div>It's in: include/llvm/CodeGen/RegisterS<wbr>cavenging.h</div>Implementation: lib/CodeGen/RegisterScavenging<wbr>.cpp<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 19, 2017 at 1:36 PM, Hong Hu via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-size:small">Hi All,</div><div style="font-size:small"><br></div><div style="font-size:small">Given a machine instruction, is it possible to tell which register(s) is still not in use? </div><div style="font-size:small"><br></div><div style="font-size:small">For example, given one instruction A, if the one follows it (say B) defines register rax, then I can tell rax should spare at instruction A. </div><div style="font-size:small"><br></div><div style="font-size:small">The purpose is to use the spare register to replace registers used by A, for instrumentation purpose.</div><div style="font-size:small"><br></div><div><div class="m_-355166172738506718m_1648218633823925671m_-3948889503114184922m_1628503878704883635m_-6826991358958350244gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Regards,<div>Hu Hong</div></div></div></div>
</div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
______________________________<wbr>_________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br></div></blockquote></div><br></div></div></div></blockquote></div><br></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>