<div dir="ltr"><div>I believe what you're after is the register scavenger.<br></div><div>It's in: include/llvm/CodeGen/RegisterScavenging.h</div>Implementation: lib/CodeGen/RegisterScavenging.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 class="gmail_default" style="font-size:small">Hi All,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Given a machine instruction, is it possible to tell which register(s) is still not in use? </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" 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 class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The purpose is to use the spare register to replace registers used by A, for instrumentation purpose.</div><div class="gmail_default" style="font-size:small"><br></div><div><div class="m_-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">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>