<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 5, 2018 at 9:58 PM, Ryan Prichard via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>2. <b>Termination landing pads.</b><br></div><div><div><div><br></div><div>Clang sometimes uses a landing pad that calls <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">__clang_call_terminate to terminate the program</span>. GCC instead leaves a gap in the call site table, and the personality routine calls <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">std::</span>terminate. For the 4MB libQt5Core.so sample I'm looking at, I think it'd reduce the size of .text and .ARM.extab by maybe 7000 bytes (about 0.18%). (I see about 500 calls to __clang_call_terminate, and I estimate 14 bytes per call, assuming the call site table is using ULEB128 already.)</div><div><br></div><div>I tried to implement this in LLVM, but couldn't find a good way to represent the calls that must be omitted from the call site table.</div><div><br></div><div>Is there a reason LLVM doesn't handle this like GCC?</div><div><br></div><div>Examples:</div><div> - C++03: <a href="https://godbolt.org/g/7BYbdG" target="_blank">https://godbolt.org/g/<wbr>7BYbdG</a></div><div> - C++11: <a href="https://godbolt.org/g/bnHLvH" target="_blank">https://godbolt.org/g/<wbr>bnHLvH</a></div></div></div></div></blockquote><div></div></div></div><div class="gmail_extra"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_extra"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">See also my comment and Reid's reply here: </span><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><a href="http://lists.llvm.org/pipermail/llvm-dev/2017-February/109995.html">http://lists.llvm.org/pipermail/llvm-dev/2017-February/109995.html</a></div><br class="gmail-Apple-interchange-newline"><br></div></div>