<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Please don't rely on this for checking whether regalloc was run: You can have functions without vregs pre-RA[1].<div class=""><br class=""></div><div class="">We don't need or should track state such as pre/post-RA as part of the function. Instead it really is a property of where a pass was scheduled, so the pass should know and not the function.</div><div class=""><br class=""></div><div class=""><div class=""><div class=""><div>I'd recommend simply creating a pre-RA and a post-RA pass instead of scheduling the same pass twice. (Of course you can share most of the pass implementation if they turn out to be similar).</div><div><br class=""></div><div>- Matthias</div><div><br class=""></div><div>[1]: While currently we do not set the NoVRrgs flag pre-ra even if there are no vregs used, when loading a .mir file for example the flag is computed from scratch and will be set.</div><div><br class=""></div><div><blockquote type="cite" class=""><div class="">On Jan 15, 2018, at 12:26 PM, Craig Topper 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="">Maybe  MF.getProperties().hasProperty(MachineFunctionProperties::Property::NoVRegs))?</div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div>
<br class=""><div class="gmail_quote">On Mon, Jan 15, 2018 at 12:07 PM, Martin J. O'Riordan via llvm-dev <span dir="ltr" class=""><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-IE" link="#0563C1" vlink="#954F72" class=""><div class="m_-8930166920810403258WordSection1"><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua",serif" class="">Hi LLVM Devs,<u class=""></u><u class=""></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua",serif" class=""><u class=""></u> <u class=""></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua",serif" class="">I have some shared code that performs lowering operations that can occur before or after register allocation.  When it is pre-RA I want to only use virtual registers for intermediate results, but post-RA I have to use only a very restricted set of physical registers.<u class=""></u><u class=""></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua",serif" class=""><u class=""></u> <u class=""></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua",serif" class="">Code generation using the restricted set is not as efficient as it is when I can use virtual registers.  At the moment I have a clunky implementation for checking whether or not the register allocator has been run, and I am wondering if there is a “correct way” of checking whether the RA pass has been run?  Some part of the register info API that I have missed perhaps?<u class=""></u><u class=""></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua",serif" class=""><u class=""></u> <u class=""></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua",serif" class="">Thanks,<u class=""></u><u class=""></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua",serif" class=""><u class=""></u> <u class=""></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua",serif" class="">            MartinO<u class=""></u><u class=""></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Book Antiqua",serif" class=""><u class=""></u> <u class=""></u></span></p></div></div><br class="">______________________________<wbr class="">_________________<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" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-dev</a><br class="">
<br class=""></blockquote></div><br class=""></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=""></div></div></div></body></html>