<div dir="ltr">Jean-Daniel,<div> The latest available release posted on their open source web site argues that that they are disabling assertions in clang.</div><div><br></div><div><a href="https://opensource.apple.com/source/clang/clang-800.0.42.1/Makefile.auto.html">https://opensource.apple.com/source/clang/clang-800.0.42.1/Makefile.auto.html</a><br></div><div><br></div><div> Jack</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 20, 2018 at 5:21 PM Jean-Daniel <<a href="mailto:mailing@xenonium.com">mailing@xenonium.com</a>> wrote:<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">I don’t think Apple disable assertion on the release build. I remember having clang and llvm crash because of assertion failure regularly at some point in the past.<div>Nowadays, it is far more unusual to get a clang crash, so I can’t tell, but I doubt they change the configuration.<br><div><br><blockquote type="cite"><div>Le 20 nov. 2018 à 16:32, Jack Howarth via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> a écrit :</div><br class="m_-6078331054769411654Apple-interchange-newline"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">The obvious question is whether the <a href="http://llvm.org/" target="_blank">llvm.org</a> builds are using -D<span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;font-variant-ligatures:normal;white-space:pre-wrap">LLVM_ENABLE_ASSERTIONS:OFF </span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap">-DCMAKE_BUILD_TYPE:STRING=</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap">Release </span><span><font color="#24292e" face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre-wrap">-DLLVM_LINK_LLVM_DYLIB:BOOL=ON which would improve the load time of the compiler by combining all of the llvm libs into a single dylib and would eliminate the speed decrease from using the default use of </span><span style="font-size:12px;white-space:pre-wrap">assertions in the built compiler</span><span style="font-size:12px;white-space:pre-wrap">.</span></font></span></div><div><span><font color="#24292e" face="SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre-wrap"> Jack</span></font></span></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 20, 2018 at 6:56 AM Tobias Hieta via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hello LLVM/Clang developers,</div><div><br></div><div>We recently switched to use the same clang version on all our platforms. This included switching from apple-clang from xcode to a pre-built binary we downloaded from <a href="http://llvm.org/" target="_blank">llvm.org</a>. We noticed that this actually came with a pretty big performance regression in compile times.</div><div><br></div><div>If we do the simplest test program like this:</div><div><br></div><div>#include <string><br>#include <iostream><br>int main()<br>{<br> std::cout << "Hello world" << std::endl;<br>}</div><div><br></div><div>and compile that with Xcode Clang (Xcode 10.1 apple-clang clang-1000.11.45.5):</div><div>clang++ test.cpp -o test 0.31s user 0.06s system 97% cpu 0.380 total</div><div><br></div><div>with clang 7 binaries found on <a href="http://llvm.org/" target="_blank">llvm.org</a> 7.0.0:</div><div>~/Downloads/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang++ -o test test.cpp 0.53s user 0.11s system 62% cpu 1.032 total</div><div><br></div><div>If we now run that on our whole project:</div><div>with xcode clang:</div><div>368.17s user 32.00s system 663% cpu 1:00.30 total</div><div><br></div><div>with clang 7:</div><div>423.31s user 31.65s system 662% cpu 1:08.69 total</div><div><br></div><div>That's a pretty hefty difference. Any ideas what can account for this discrepancy? Does apple-clang contain any special patches or build flags that differ a lot from the binaries on <a href="http://llvm.org/" target="_blank">llvm.org</a>?</div><div><br></div><div>I know about PGO - and I guess the best we could do is to get profile data out of compiling my whole tree and use that when building clang - but this process seems not very well documented and unsure if this would even help.</div><div><br></div><div>Thankful for any ideas or feedback.</div><div>Tobias<br></div></div></div></div></div></div></div></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>
_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br></div></blockquote></div><br></div></div></blockquote></div>