<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 13 Aug 2014, at 14:20, Tim Northover <<a href="mailto:t.p.northover@gmail.com" class="">t.p.northover@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">Any thoughts? Does the RSP clobber make sense?<br class=""></blockquote><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I suspect it's mostly academic from a purely codegen perspective since</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">%rsp is a reserved register and so only X86-specific code that knows</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">about it will touch it.</span></div></blockquote></div><br class=""><div class="">If it were the x86 code declaring it clobbered, I could believe that. However, it's marked clobbered by some generic code which seems to be there for handling totally unrelated stuff (return values)[0]. The fact that FastISel and SelectionDAGISel handle it differently makes it look even more suspicious.</div><div class=""><br class=""></div><div class="">I’m not saying it’s wrong. You’re right that from a purely academic POV, the call will actually write to %rsp. And it seems it never caused any trouble. It makes however other things, like the liveness analysis I pointed out, more difficult with no other apparent gain.</div><div class=""><br class=""></div><div class="">Fred</div><div class=""><br class=""></div><div class="">[0] : For reference, the commit introducing the RegMask handling that clobbers %rsp is:</div><div class=""><div class="">commit 77180e0b402fff318cffd89a2251e46b3dce4064</div><div class="">Author: Jakob Stoklund Olesen <<a href="mailto:stoklund@2pi.dk" class="">stoklund@2pi.dk</a>></div><div class="">Date:   Fri Feb 3 21:23:14 2012 +0000</div><div class=""><br class=""></div><div class="">    Handle register mask operands in setPhysRegsDeadExcept().</div><div class="">    </div><div class="">    Calls that use register mask operands don't have implicit defs for</div><div class="">    returned values.  The register mask operand handles the call clobber,</div><div class="">    but it always behaves like a set of dead defs.</div><div class="">    </div><div class="">    Add live implicit defs for any implicitly defined physregs that are</div><div class="">    actually used.</div><div class="">    </div></div><div class=""><div class="">    git-svn-id: <a href="https://llvm.org/svn/llvm-project/llvm/trunk@149715" class="">https://llvm.org/svn/llvm-project/llvm/trunk@149715</a> 91177308-0d34-041</div></div><div class=""><br class=""></div></body></html>