<div dir="ltr"><div>Hi Chandler and everyone ,</div><div>To be specific ,</div><div><br></div><div>We have the module pass ,that get the Function analysis Pass (RegionInfo) for each function and get populated to the vector RegionTree as show below . (assumption we have is that ,Every module has less than 16 functions for testing )</div><div><br></div><div>namespace {<br></div><div>struct TestPass : public ModulePass {</div><div> static char ID; // Pass identification, replacement for typeid</div><div> SmallVector<RegionInfo , 16> RegionTree;</div><div> TestPass() : ModulePass(ID) {</div><div> }</div><div><br></div><div> bool runOnModule(Module &M) override {</div><div style="text-align:left"> if (skipModule(M))</div><div style="text-align:left"> return false;</div><div style="text-align:left"> for (Function &Func : M) {</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div style="text-align:left"> if (!Func.isDeclaration() && !Func.hasAvailableExternallyLinkage()) {</div><div style="text-align:left"> RegionTree.push_back(std::move(this->getAnalysis<RegionInfoPass>(Func).getRegionInfo())); </div><div style="text-align:left"> }</div></blockquote><div style="text-align:left"> }</div><div style="text-align:left"> for (SmallVectorImpl<RegionInfo>::iterator RI = RegionTree.begin(),</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div style="text-align:left"> RE = RegionTree.end();</div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div style="text-align:left"> RI != RE; ++RI) {</div></blockquote></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div style="text-align:left"> RI->dump();</div><div style="text-align:left">}</div></blockquote></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div style="text-align:left"> return false;</div></blockquote><div> }</div><div><br></div><div> void getAnalysisUsage(AnalysisUsage &AU) const override {</div><div> AU.addRequired<DominatorTreeWrapperPass>();</div><div> AU.addRequired<RegionInfoPass>();</div><div> }</div><div>};</div><div>}</div><div><br></div><div>char TestPass::ID = 0;</div><div>static RegisterPass<TestPass></div><div>Z("testpass", "region Pass");</div><div><br></div><div><br></div><div>Question is ,Can you(chandler ) or anyone in the dev list ,please help us to port the above module pass to new pass manager design ?</div><div><br></div><div>Any Doc or source will help us a lot </div><div><br></div><div>Thank you </div><div>~Umesh </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 3, 2016 at 2:48 PM, Umesh Kalappa <span dir="ltr"><<a href="mailto:umesh.kalappa0@gmail.com" target="_blank">umesh.kalappa0@gmail.com</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">Hi Chandler and All ,<div><br></div><div>Thank you for the new design on the pass manager ,<a href="http://llvm.org/devmtg/2014-10/Slides/Carruth-TheLLVMPassManagerPart2.pdf" target="_blank">http://llvm.org/devmtg/2014-1<wbr>0/Slides/Carruth-TheLLVMPassMa<wbr>nagerPart2.pdf</a></div><div><br></div><div>We are coming up with new module pass ,that uses the region pass analysis (RPM),we have few queries like ,</div><div><br></div><div>a)can we model our requirements with your new design ,using the ModelToFunctionPassAdaptor /Proxies ?</div><div><br></div><div>b)Region Pass /Region Pass Manager uses the legacy pass manager and not refactored to new design ,Do you have plans for it ?</div><div><br></div><div>c)Any document for your new design ,other than mail threads or ppt doc ?</div><div><br></div><div>Will be highly appreciate any inputs here </div><span class="HOEnZb"><font color="#888888"><div>~Umesh</div></font></span></div>
</blockquote></div><br></div>