[llvm] r314937 - [MachineBlockPlacement] Make sure PreferredLoopExit is cleared everytime new loop is processed

Xin Tong via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 5 17:56:57 PDT 2017


Hi Bruno

I already revert the broken part in r315032. The rest of the patch is fine.
I am trying to come up with a test case.
-Xin

On Fri, Oct 6, 2017 at 9:52 AM, Bruno Cardoso Lopes <bruno.cardoso at gmail.com
> wrote:

> This is breaking our internal stage2 bots:
>
> Assertion failed: (L.isLoopExiting(PreferredLoopExit) && "not an
> exiting block of current loop"), function buildLoopChains, file
> /clang/src/lib/CodeGen/MachineBlockPlacement.cpp, line 2246.
>
> It triggers when stage1 is compiling stage2's BranchFolding.cpp. I
> don't have a reproducer I can share at the moment, do you mind If I
> revert this until I can provide you a reduced testcase?
>
> Thanks,
>
> On Wed, Oct 4, 2017 at 2:39 PM, Xin Tong via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
> > Author: trentxintong
> > Date: Wed Oct  4 14:39:25 2017
> > New Revision: 314937
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=314937&view=rev
> > Log:
> > [MachineBlockPlacement] Make sure PreferredLoopExit is cleared everytime
> new loop is processed
> >
> > Summary: Rotate on exit that actually exits the current loop.
> >
> > Reviewers: davidxl, danielcdh, iteratee, chandlerc
> >
> > Subscribers: llvm-commits
> >
> > Differential Revision: https://reviews.llvm.org/D38563
> >
> > Modified:
> >     llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp
> >
> > Modified: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/MachineBlockPlacement.cpp?rev=314937&r1=314936&r2=314937&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Wed Oct  4
> 14:39:25 2017
> > @@ -2233,9 +2233,19 @@ void MachineBlockPlacement::buildLoopCha
> >    // If we selected just the header for the loop top, look for a
> potentially
> >    // profitable exit block in the event that rotating the loop can
> eliminate
> >    // branches by placing an exit edge at the bottom.
> > +  //
> > +  // Loops are processed innermost to uttermost, make sure we clear
> > +  // PreferredLoopExit before processing a new loop.
> > +  PreferredLoopExit = nullptr;
> >    if (!RotateLoopWithProfile && LoopTop == L.getHeader())
> >      PreferredLoopExit = findBestLoopExit(L, LoopBlockSet);
> >
> > +  // Make sure PreferredLoopExit actually exits the current loop.
> > +  if (PreferredLoopExit) {
> > +    assert(L.isLoopExiting(PreferredLoopExit) &&
> > +           "not an exiting block of current loop");
> > +  }
> > +
> >    BlockChain &LoopChain = *BlockToChain[LoopTop];
> >
> >    // FIXME: This is a really lame way of walking the chains in the
> loop: we
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
>
> --
> Bruno Cardoso Lopes
> http://www.brunocardoso.cc
>



-- 
Software Engineer - Compiler Toolchain
Employee of Facebook Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171006/687119f6/attachment.html>


More information about the llvm-commits mailing list