<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=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jul 6, 2016, at 9:39 PM, vivek pandya <<a href="mailto:vivekvpandya@gmail.com" class="">vivekvpandya@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; 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-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; 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-stroke-width: 0px;">On Wed, Jul 6, 2016 at 8:58 AM, vivek pandya<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:vivekvpandya@gmail.com" target="_blank" class="">vivekvpandya@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote"><span class="">On Tue, Jul 5, 2016 at 11:54 PM, Mehdi Amini<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:mehdi.amini@apple.com" target="_blank" class="">mehdi.amini@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><span class=""><br class="">> On Jul 5, 2016, at 9:28 AM, vivek pandya <<a href="mailto:vivekvpandya@gmail.com" target="_blank" class="">vivekvpandya@gmail.com</a>> wrote:<br class="">><br class="">> Hello Mentors,<br class="">><br class="">> I have a very naive idea to get IPRA woking at link time and thus extending its scope to intermodule. I seek some help if it seems to be a feasible idea.<br class="">><br class="">> So idea is to take advantage of LTO's capability to work with bit code files. LTO can optimize number of bitcode files and combine them into a big module. LTO then generates native code for the big module.<br class=""><br class=""></span>Yes, that’s how LTO works.<br class=""><span class=""><br class="">><br class="">> So does it seem feasible to have clang generates bit code files for the source code and then combine then with LTO and LTOCodeGenerater will use current IPRA infrastructure, so IPRA will be improved as now it can propagate actual regmask for procedures define in other modules (not system/external library calls). If this is possible then one problem I can sense is requirement of huge memory to hold a big module for large projects.<br class=""><br class=""></span>I don’t understand what you describe, or how it changes from LTO how it works right now.<br class=""><br class="">IPRA, how we implemented it, is a simple “codegen option” that can be enabled during LTO.<br class=""></blockquote></span><div class="">Ok I got your point. So using IPRA during LTO is a way to get most benefit out of IPRA but h\this will incur some overheads due to LTO. I think it would be better to try this experiment with a small application to provide a good example of this.</div><span class=""><font color="#888888" class=""><div class="">-Vivek</div></font></span></div></div></div></blockquote><div class="">I tried to use IPRA with -flto option like -flto -mllvm -enable-ipra -mllvm -debug-only=ip-regalloc but it seems that while lto is enabled code generator does not enable IPRA. because I don't get any debug information. Or Am I missing any options related to LTO here ?</div></div></div></blockquote><div class=""><br class=""></div><div class="">You have to understand that there are two phases: compile to .o (bitcode when -flto is supplied) and linking.</div><div class="">The linking phase is actually when the code generator runs, so you need to pass the option to LLVM through the linker.</div><div class="">On OS X the linker will accept -mllvm options, but when you invoke the link phase through clang you have to use -Wl, to pass the option to the linker.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">— </div><div class="">Mehdi</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; 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-stroke-width: 0px;"><div class=""><br class=""></div><div class="">-Vivek</div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><span class=""><font color="#888888" class=""><div class=""> </div></font></span><span class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">I think at some point at the beginning of the project, you mentioned some paper about IPRA during link-time and we told you that it was not relevant for LLVM because of the way LTO works: IPRA can be enabled transparently during LTO.<br class=""><br class="">—<br class=""><span class=""><font color="#888888" class="">Mehdi<br class=""></font></span><div class=""><div class=""><br class=""><br class="">><br class="">> If this idea seems feasible please help me to shape a concrete work plan on this.<br class="">><br class="">> Sincerely,<br class="">> Vivek</div></div></blockquote></span></div></div></div></blockquote></div></div></blockquote></div><br class=""></div></div></body></html>