<div class="gmail_quote">On Tue, May 17, 2011 at 2:52 PM, Jakob Stoklund Olesen <span dir="ltr"><<a href="mailto:stoklund@2pi.dk">stoklund@2pi.dk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On May 17, 2011, at 11:32 AM, Andrew Clinton wrote:<br>
<br>
> On 05/17/2011 12:54 PM, Jakob Stoklund Olesen wrote:<br>
</div><div class="im">>> What you can do instead is:<br>
>><br>
>> 1) Just use virtual registers and skip register allocation, or<br>
>><br>
>> 2) Allocate to a small register file, implement memory operand folding, and pretend that spill slots are registers.<br>
>><br>
>> /jakob<br>
>><br>
><br>
> Empirically, 1) is not true.  The linear scan register allocator appears<br>
> to do a very good job of reusing registers that have been killed.  It<br>
> also automatically inserts copies for operations that clobber register<br>
> operands, and coalesces identity register moves.<br>
<br>
</div>Good point. The 2-addr, phi-elim, and coalescer passes are definitely helpful.<br>
<br>
The final register allocator pass that assigns physical registers probably doesn't help you much.<br>
<font color="#888888"><br></font></blockquote><div><br></div><div>I plan on eventually implementing both and seeing which works best for different types of input.</div><div><br></div><div>If virtual registers are used, how do you disable final register allocation in the back-end?  Looking through the different Target* classes, I do not see any way to disable it.  I imagine the TargetRegisterClass implementations are still needed to determine legal virtual register types, but are physical register definitions still needed? This would seem to defeat the purpose of using virtual registers in the first place.  Unfortunately, there do not seem to be any documentation (or even existing back-ends) using this approach.</div>
<div><br></div><div>For the stack slot approach, what exactly are the semantics of the foldMemoryOperandImpl method?  And how does it relate to the storeRegToStackSlot and readRegFromStackSlot methods?  Do the storeReg/readReg methods generate the (load/store) spill code and the foldMemoryOperandImpl method combine the generated loads/stores directly into the instructions that reference them?</div>
<div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><font color="#888888">
/jakob<br>
</font><div><div></div><div class="h5"><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><br clear="all"><br>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div><br>