<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 14, 2018, at 9:42 AM, Steven Wu via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">For the stage 2 build, just use clang/cmake/caches/Apple-stage2-ThinLTO.cmake. I also throw a profile data in my build just to match our builder but I suspect that might not be needed. I will double check to confirm that.</div></div></blockquote><div><br class=""></div><div>I was wrong. Profile data is needed to reproduce it. Let me try reproduce it fully from trunk and see if I can share the profdata with you.</div><div><br class=""></div><div>Steven</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">You also don't need to wait for the entire build to finish. Just run `ninja libclang.dylib && ninja clang-func-mapping` is consistently reproducing for me. Let me know if you need more help with this.</div><div class=""><br class=""></div><div class="">Another note, it will be good to add assembly support for readonly bits. It will be easier to debug.</div><div class=""><br class=""></div><div class="">Steven</div><div class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Nov 14, 2018, at 9:27 AM, Evgeny Leviant <<a href="mailto:eleviant@accesssoftek.com" class="">eleviant@accesssoftek.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="margin-top: 0px; margin-bottom: 0px; caret-color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration: none;" class="">I couldn't reproduce this on Linux, now trying Mac OS X (will take the whole night as it is slow)<br class=""></div><div style="margin-top: 0px; margin-bottom: 0px; caret-color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration: none;" class="">Stewen, can you please send me CMake configuration string from your buildbot. It would be helpful <br class=""></div><div style="margin-top: 0px; margin-bottom: 0px; caret-color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration: none;" class="">if pending OS X build also succeed.<br class=""></div><div style="margin-top: 0px; margin-bottom: 0px; caret-color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration: none;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px; caret-color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration: none;" class="">What I'm doing is:<br class=""></div><div style="margin-top: 0px; margin-bottom: 0px; caret-color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration: none;" class="">- build LLVM/clang with thin LTO cache<br class=""></div><div style="margin-top: 0px; margin-bottom: 0px; caret-color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration: none;" class="">- When finished remove cache from disk, then remove and rebuild libclang.so(dylib)<br class=""></div><div style="margin-top: 0px; margin-bottom: 0px; caret-color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration: none;" class="">- Remove and rebuild clang-func-mapping<br class=""></div><div style="margin-top: 0px; margin-bottom: 0px; caret-color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration: none;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px; caret-color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration: none;" class="">Are those steps correct?<br class=""></div><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration: none; color: rgb(33, 33, 33);" class=""><div class=""><hr tabindex="-1" style="display: inline-block; width: 1010.375px;" class=""><div id="x_divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">От:</b><span class="Apple-converted-space"> </span>Teresa Johnson via Phabricator <<a href="mailto:reviews@reviews.llvm.org" class="">reviews@reviews.llvm.org</a>><br class=""><b class="">Отправлено:</b><span class="Apple-converted-space"> </span>14 ноября 2018 г. 19:00<br class=""><b class="">Кому:</b><span class="Apple-converted-space"> </span>Evgeny Leviant;<span class="Apple-converted-space"> </span><a href="mailto:tejohnson@google.com" class="">tejohnson@google.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:joker.eph@gmail.com" class="">joker.eph@gmail.com</a><br class=""><b class="">Копия:</b><span class="Apple-converted-space"> </span><a href="mailto:trent.xin.tong@gmail.com" class="">trent.xin.tong@gmail.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:arphaman@gmail.com" class="">arphaman@gmail.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:dany.grumberg@gmail.com" class="">dany.grumberg@gmail.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:jfbastien@apple.com" class="">jfbastien@apple.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:anton@korobeynikov.info" class="">anton@korobeynikov.info</a>;<span class="Apple-converted-space"> </span><a href="mailto:llvm@inglorion.net" class="">llvm@inglorion.net</a>;<span class="Apple-converted-space"> </span><a href="mailto:eraman@google.com" class="">eraman@google.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:stevenwu@apple.com" class="">stevenwu@apple.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:dexonsmith@apple.com" class="">dexonsmith@apple.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>; George Rimar; Igor Kudrin;<span class="Apple-converted-space"> </span><a href="mailto:jun.l@samsung.com" class="">jun.l@samsung.com</a><br class=""><b class="">Тема:</b><span class="Apple-converted-space"> </span>[PATCH] D49362: [ThinLTO] Internalize read only globals</font><div class=""> </div></div></div><font size="2" class=""><span style="font-size: 10pt;" class=""><div class="PlainText">CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.<br class=""><br class="">tejohnson added a comment.<br class=""><br class="">In<span class="Apple-converted-space"> </span><a href="https://reviews.llvm.org/D49362#1297188" class="">https://reviews.llvm.org/D49362#1297188</a>, @steven_wu wrote:<br class=""><br class="">> I reverted this in r346768.<br class="">><br class="">> I think this is indeed a caching problem. There are some dylib/binary in clang projects that toggles whether to enable the recovery context but some does not. I can reproduce the issue by thin link libclang.dylib first, then link clang-func-mapping on Darwin.<br class="">>  libclang.dylib thinks the file scope variable gCrashRecoveryEnabled not read-only, so it promotes it.<br class="">>  clang-func-mapping thinks gCrashRecoveryEnabled read-only, so it internalize and constant propagate the variable but ParseAST.o in the cache is still expecting gCrashRecoveryEnabled to be available.<br class="">><br class="">> Let me know if you need more information.<br class=""><br class=""><br class="">Thinking through this example, I'm not sure what is going on. This patch did change the cache key computation to include the read only bit from the global var summary of anything defined or imported. Since gCrashRecoveryEnabled is a static in CrashRecoveryContext.cpp, it must have been imported into ParseAST.o, which means that the read only bit on the associated gvar summary should have been hashed into ParseAST.o's cache key. So presumably we shouldn't have had a cache hit for ParseAST.o (built when the read only bit is not set on gCrashRecoveryEnabled) when thin linking clang-func-mapping which has this bit set for that variable.<br class=""><br class="">Even if the variable was originally externally visible, in order for it to be marked read only by the thin link it would have had to have been imported at all use sites. Which means that any referencing module had to have it in the import set (and therefore would have hashed the read only bit) in the thin link where it was marked read only. So I am not sure offhand why we could ever share a referencing object between a link where it was read only and another link where it is not...   Hopefully Eugene can figure out what is going wrong here.<br class=""><br class=""><br class="">Repository:<br class="">  rL LLVM<br class=""><br class=""><a href="https://reviews.llvm.org/D49362" class="">https://reviews.llvm.org/D49362</a><br class=""><br class=""><br class=""><br class=""></div></span></font></div></div></blockquote></div><br class=""></div></div>_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""></div></blockquote></div><br class=""></body></html>