<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi Brian,</div><div class=""><br class=""></div>+1 on what Nemanja said: specifying large register classes is the key.<div class=""><br class=""></div><div class="">More details here:</div><div class=""><a href="http://lists.llvm.org/pipermail/llvm-dev/2019-December/137700.html" class="">http://lists.llvm.org/pipermail/llvm-dev/2019-December/137700.html</a></div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">-Quentin<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Sep 9, 2020, at 11:13 AM, Nemanja Ivanovic 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="">On PowerPC, we implemented support for spilling GPR registers to vector registers. Essentially, it requires specifying the correct register class in `getLargestLegalSuperClass()` as well as `storeRegToStackSlot()/loadRegFromStackSlot()`. You can see what is controlled with the `EnableGPRToVecSpills` option.<br class=""></div><div class=""><br class=""></div><div class="">If you also want to use this method for spilling callee-saved registers to other registers, you can do what we do on PPC in `assignCalleeSavedSpillSlots()` to specify the destination register. This should also ensure that the CFI directives are emitted correctly. Keep in mind that this can likely only be done for leaf functions since you'll likely be spilling these to caller-saved registers of the other class.</div><div class=""><br class=""></div><div class="">Hope this helps,</div><div class="">Nemanja<br class=""></div><div class=""><br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 9, 2020 at 1:30 PM Bagel via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Given an architecture with two classes of registers: A is general purpose and <br class="">
has an "adequate" number of registers, and C which is special purpose and has <br class="">
very few (e.g. one) register. There are cheap instructions that directly copy <br class="">
from C to A and vice versa.<br class="">
<br class="">
If we need another C register and they are all live, we need to spill one. <br class="">
Currently as far as I can tell, the only way to do that is spill to the stack. <br class="">
Is there a knob I can turn to get the spill from C to go to an A register?<br class="">
<br class="">
Thanks,<br class="">
brian<br class="">
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
</blockquote></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="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>