<div>                Hi Johannes,<br><br>This is very helpful and thank you for the quick response.<br><br>I imagine that the usual nested loop structure is something like:<br><br>loop1_header_bb<br>bbs_between_loop1_header_and_loop2_header<br>loop2_header_bb<br>loop_body_bbs<br>br loop2_header_bb<br>instructions_before_loop1_end_and_after_loop2_end<br>br loop1_header_bb<br><br>In this case you mean that loop2_header_bb might need to be split before extracting loop 2 into its own function? I'm not sure yet about how to use bb splitting to enable inner-loop extraction and what splitting edges means.<br><br>Sincerely, <br>Iulian<br>            </div>            <div class="yahoo_quoted" style="margin:10px 0px 0px 0.8ex;border-left:1px solid #ccc;padding-left:1ex;">                        <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">                                <div>                    On Wednesday, July 1, 2020, 06:06:01 PM EDT, Johannes Doerfert <johannesdoerfert@gmail.com> wrote:                </div>                <div><br></div>                <div><br></div>                <div><div id="yiv1558304884"><div>    <p><font face="Hack Nerd Font Mono">Hi Iulian,</font></p>    <p><font face="Hack Nerd Font Mono"><br clear="none">      </font></p>    <p><font face="Hack Nerd Font Mono">On first thought I would think        that extracting top-level loops is only minimally easier than        extracting any other loop level,</font></p>    <p><font face="Hack Nerd Font Mono">if you consider arbitrary input,        e.g,. potential irreducible "outer-outer-most" loops. For inner        ones you might want to split</font></p>    <p><font face="Hack Nerd Font Mono"> some blocks and edges to make        sure they are not shared with the outer loop but other than        that, I imagine it to be pretty similar.</font></p>    <p><font face="Hack Nerd Font Mono"> (This assumes you do not want        to preserve things like LoopInfo, ScalarEvolution, ...). <br clear="none">      </font></p>    <p><font face="Hack Nerd Font Mono">Extracting a single basic block        is probably easier still. Again, assuming you do not want to        update analyses.</font></p>    <p><font face="Hack Nerd Font Mono"><br clear="none">      </font></p>    <p><font face="Hack Nerd Font Mono">If you want more details or        think I haven't grasped the essence of your questions, feel free        to say so :)<br clear="none">      </font></p>    <p><font face="Hack Nerd Font Mono"><br clear="none">      </font></p>    <p><font face="Hack Nerd Font Mono">~ Johannes</font></p>    <p><font face="Hack Nerd Font Mono"><br clear="none">      </font></p>    <p><font face="Hack Nerd Font Mono"><br clear="none">      </font></p>    <div class="yiv1558304884moz-cite-prefix">On 7/1/20 4:23 PM, iulian brumar via      llvm-dev wrote:<br clear="none">    </div>    <blockquote type="cite">      <pre class="yiv1558304884moz-quote-pre">Hello everyone,Quick question about loop extraction in llvm. I've been using the LoopExtractor pass in llvm/lib/Transforms/IPO/LoopExtractor.cpp to extract top level loops from programs.I'm wondering if extracting inner-most loops is any more complex than using the BlockExtractor pass in llvm/lib/Transforms/IPO/BlockExtractor.cpp and making sure that the basic blocks in the extracted region are single entry-single exit. Would there be any fundamental differences wrt what LoopExtractor is doing for top-level loops?Thanks,Iulian_______________________________________________LLVM Developers mailing list<a rel="nofollow" shape="rect" class="yiv1558304884moz-txt-link-abbreviated" ymailto="mailto:llvm-dev@lists.llvm.org" target="_blank" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><a rel="nofollow" shape="rect" class="yiv1558304884moz-txt-link-freetext" target="_blank" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></pre>    </blockquote>  </div></div></div>            </div>                </div>