<div dir="ltr"><br><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><i><font size="2" face="monospace, monospace"><b>Vivek Pandya</b></font></i><div><br></div></div></div></div></div></div>
<br><div class="gmail_quote">On Fri, Mar 18, 2016 at 10:03 PM, Quentin Colombet <span dir="ltr"><<a href="mailto:qcolombet@apple.com" target="_blank">qcolombet@apple.com</a>></span> wrote:<br><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 style="word-wrap:break-word">Hi Vivek,<div><br><div><span class=""><blockquote type="cite"><div>On Mar 16, 2016, at 1:00 PM, vivek pandya via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br><div><div dir="ltr">Hello,<div><br></div><div>Probably this may be too late to start thinking about this project but I think this is particularly useful feature for LLVM. </div></div></div></blockquote><div><br></div></span><div>+1. I’d like to use something this feature in GlobalISel. The idea is that has as soon as we lowered the LLVM IR of the whole module to MachineInstr, the LLVM IR should be deallocable.</div><div>In other words, the MachineModule/MachineFunctions should contain enough information such that we do not have to keep the LLVM IR around.</div><div><br></div><div>One of the main challenge is about alias analysis information that are tight with LLVM IR, but may be used in MachineFunctionPass.</div><span class=""><br><blockquote type="cite"><div><div dir="ltr"><div>A quick use I can think of this is Implementing Inter-procedural Register Allocation ( for Research purpose ).</div><div><br></div><div>I have start looking at the code for MachineFunctionPass, I think currently MachineModule class is not available ( the project work will include that ) but trying to find out required details to first create a MachineModule class which holds references to required information. I am also trying to figure out what are the things should compose MachineModule class ( some sort of analogy with Module class used for IR passes)</div></div></div></blockquote><div><br></div></span><div>At least for GlobalISel, we would need a way to create and get the global variables of a Module, but lowered to MachineInstr (or MC) level.</div><span class=""><br></span></div></div></div></blockquote><div>Looking at the current implementation of the Module class, it seems that Module class maintains Linked List to GlobalVariables, Functions, GlobalAliasis ... and meta informations about the Module like file name , Module ID , Target Triple DataLayout etc.  And currently for MachineFunction pass MachineFunctionAnalysis creates object of MachineFunction. The MachineFunction constructor takes Function, TargetMachine etc as arguments and creates MachineBasicBlocks and thus provides access to MachineInstr. </div><div><br></div><div>Now I have very rough idea to inherit the Module Pass and use the information available in Module class to create MachineModule class. MachineModule class should use MachineFunctionAnalysis to create MachineFunction for each Function F in Module class MachineModule class should create links between all these MachineFunction object as per the original linked list of Function objects. Similarly we need to get MC lowered representation for each features of Module class when it is possible and we should also preserve some IR Analysis that are useful at later stage. </div><div>Then we provide various method to use this information (access GlobalVariable etc)  as similar to Module class. Once we have MachineModule class ready  we can use this to execute user specific operation on each function or provide user iterators for MachineFunction list.  </div><div><br></div><div>I think I need to look at how LLVM IR is lowered to MachineIR to understand this better. </div><div>Please provide some more info or analysis so that I can build a reasonable and promising work plan for this.</div><div><br></div><div>Sincerely,</div><div>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 style="word-wrap:break-word"><div><div><span class=""><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>After that I think next step is to extend the ModulePass and let ModulePass execute optimization provide enough information.</div></div></div></blockquote><div><br></div></span>+1</div><div><span class=""><br><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>Am I going in correct direction?</div></div></div></blockquote><div><br></div></span><div>Yes, at least, it makes sense to me.</div><br><blockquote type="cite"><div><div dir="ltr"><div>Please provide some pointers.</div></div></div></blockquote><div><br></div><div>Other than gathering feedback on what is needed and trying, I unfortunately cannot offer anything else.</div><div><br></div>Cheers,</div><div>-Quentin<br><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>Sincerely,<br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><i><font size="2" face="monospace, monospace"><b>Vivek Pandya</b></font></i><div><br></div></div></div></div></div></div>
</div></div>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br></div></blockquote></div><br></div></div></blockquote></div><br></div></div>