<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Note that this only works for targets that say TargetRegisterInfo::trackLivenessAfterRegAlloc()== true.</div><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 16, 2017, at 1:21 PM, Quentin Colombet via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Anitha,<div class=""><br class=""></div><div class="">The liveness information is usually dropped after regalloc.</div><div class="">Therefore the short answer is no, this information is not available before producing assembly.</div><div class=""><br class=""></div><div class="">However, we have the live-ins and you can request the kill flag to be set. From both this information, you can recompute the liveness.</div><div class="">I’d suggest you use the LivePhysReg helper class and use its result to annotate your assembly (emitComment or something along those lines).</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">-Quentin</div><div class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 16, 2017, at 12:46 PM, Anitha B Gollamudi via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi,<br class=""><br class=""></div><div class="">Is there a way to print the register liveness information into the assembly file or as some intermediate listing?<br class=""></div><div class="">To be more precise, I am looking at figuring out the following information in an assembly file/listing.<br class=""><br class=""></div><div class="">Say, for simplicity, our register set is only { rsp, rbp, eax }<br class=""></div><div class=""><br class=""><br class=""></div><div class="">subq    $16, %rsp     // rsp is killed here, eax and rbp are live<br class="">movl    $0, -4(%rbp)  // rbp is killed here, rsp and eax are live<br class="">xorl    %eax, %eax    // eax is killed here, rsp and rbp are live<br class="">movl    $1, %eax   // eax is killed here, rsp and rbp are live<br class=""><br class=""></div><div class="">Is there a way LLVM stores this information somewhere before producing assembly?<br class=""></div><div class="">I
 haven't  dug into the source code yet, but intuitively the information 
must be there and hence maybe some pass dumps that info?<br class=""><br class=""></div>Thanks!<br class=""><br class=""><div class="gmail_signature"><i style="font-family:times new roman,serif" class=""><b class=""> Anitha</b></i><br class=""></div>
</div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class=""></div></blockquote></div><br class=""></div></div>_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>