<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Yes, RegMask is what you should use for the CallPreservedMask.<div class="">It means that the registers set as 1 are preserved from the Call (the callee saved) and the ones marked as 0 need to be saved instead.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Marcello<br class=""><div><blockquote type="cite" class=""><div class="">On 26 Aug 2015, at 18:51, Xiaochu Liu <<a href="mailto:xiaochu1122@gmail.com" class="">xiaochu1122@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Marcello,<div class=""><br class=""></div><div class="">Thanks for your reply. I will try to pass down the mask!</div><div class="">I have one more question. I<span style="line-height:1.5;font-size:13.1999998092651px" class="">n my backend I return </span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre" class="">CSR_RegMask</span><span style="line-height:1.5;font-size:13.1999998092651px" class=""> in getCallPreservedMask and return </span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre" class="">CSR_SaveList</span><span style="line-height:1.5;font-size:13.1999998092651px" class=""> in getCalleeSavedRegs. Is that a correct setup? I dumped the regmask and found that callee saved regs are marked 1 and non-callee saved regs are 0. </span></div><div class=""><br class=""></div><div class=""><span style="font-size:13.1999998092651px;line-height:1.5" class="">Thanks,</span></div><div class=""><span style="font-size:13.1999998092651px;line-height:1.5" class="">Xiaochu</span></div><div class=""><span style="font-size:13.1999998092651px;line-height:1.5" class=""><br class=""></span></div><div class=""><br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Wed, Aug 26, 2015 at 5:58 PM Marcello Maggioni <<a href="mailto:mmaggioni@apple.com" class="">mmaggioni@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Is the preserved mask passed down to your Call instruction in LowerCall ?<div class=""><br class=""></div><div class="">Marcello<br class=""><div class=""><blockquote type="cite" class=""></blockquote></div></div></div><div style="word-wrap:break-word" class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="">On 26 Aug 2015, at 17:52, Xiaochu Liu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class=""></blockquote></div></div></div><div style="word-wrap:break-word" class=""><div class=""><div class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><span style="font-size:13.1999998092651px;line-height:19.7999992370605px" class="">Dear there,</span><div style="font-size:13.1999998092651px;line-height:19.7999992370605px" class=""><br class=""></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px" class="">I was wondering how to preserve registers (caller saved) across calls. I implemented getCalleeSavedRegs and getCallPreservedMask. But the non-callee-saved registers are still not saved by caller. I want to spill these registers in use on stack right before the call. From my understanding, the register allocator in llvm will do the spill and restoring automatically? Is there anything I was supposed to do to make it happen?</div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px" class=""><br class=""></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px" class="">Thanks,</div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px" class="">Xiaochu</div></div></div></blockquote></div></div></div><div style="word-wrap:break-word" class=""><div class=""><div class=""><blockquote type="cite" class=""><div 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://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Ddev&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=THu9ANfN9LYlQTYNQdmA7D-MsdMl2OioTAKXjMfn7i4&m=T0_ZG8YhyugTycTFs3lQPt6d4mu6n739A4TOI-X1aJ0&s=xBBwHMhNOhAnZr_RXMJN6_kyjY2Wnap1c9aCtrfM7T8&e=" target="_blank" class="">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Ddev&d=BQIGaQ&c=eEvniauFctOgLOKGJOplqw&r=THu9ANfN9LYlQTYNQdmA7D-MsdMl2OioTAKXjMfn7i4&m=T0_ZG8YhyugTycTFs3lQPt6d4mu6n739A4TOI-X1aJ0&s=xBBwHMhNOhAnZr_RXMJN6_kyjY2Wnap1c9aCtrfM7T8&e=</a> <br class=""></div></blockquote></div><br class=""></div></div></blockquote></div>
</div></blockquote></div><br class=""></div></body></html>