<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace;font-size:small"><span style="font-family:arial,sans-serif">On Tue, Apr 10, 2018 at 11:39 AM, Francis Visoiu Mistrih </span><span dir="ltr" style="font-family:arial,sans-serif"><<a href="mailto:francisvm@yahoo.com" target="_blank">francisvm@yahoo.com</a>></span><span style="font-family:arial,sans-serif"> wrote:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><span></span><div><div><div><span class=""><blockquote type="cite"><div dir="ltr"><div style="font-family:monospace,monospace"><font size="2"><br>I've "fixed" this by modifying `ShrinkWrap::useOrDefCSROrFI` to explicitly check<br>for the stack pointer register (using<br>`TLI.getStackPointerRegisterTo<wbr>SaveRestore`)</font></div></div></blockquote><div><br></div></span><div>This part sounds ok to me. Can you put up a patch please?</div></div></div></div></div></blockquote><div><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">​Yes, working on it...​</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small"><br></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;line-break:after-white-space"><div><div><div><span class=""><br><blockquote type="cite"><div dir="ltr"><div style="font-family:monospace,monospace"><font size="2">and also to ignore tall call<br>instructions (`isCall() && isReturn()`), since they implictly use SP (for<br>AArch{32,64} at least).<br></font></div></div></blockquote><div><br></div></span><div>Calls are handled through the regmask check, and return blocks should be handled by the common-dominator call. Did you run into any issues with this? Marking blocks containing `isReturn` instructions as used will basically make shrink-wrapping to fail all the time.</div></div></div></div></div></blockquote><div><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">​Actually, I do just the opposite, make sure tail calls do not prevent a block from being used as a save/restore point, regardless of the fact that</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">a tail call may use SP.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">​</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;line-break:after-white-space"><div><div><div><span class=""><br><blockquote type="cite"><div dir="ltr"><div style="font-family:monospace,monospace"><font size="2"><br>Does this look correct? Are there alternatives?<br></font></div></div></blockquote><div><br></div></span><div>Another thing we could do is to add SP (through TLI.<wbr>getStackPointerRegisterToSaveR<wbr>estore) to the CurrentCSRs set (and probably rename the set).</div></div></div></div></div></blockquote></div><br></div><div class="gmail_extra"><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">​Right, make sense.</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small"><br></div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">Thanks a lot,</div><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">Momchil Velikov​</div><br></div></div>