[llvm-dev] MachineBasicBlock asserts in erase() and move()

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 16 13:11:21 PDT 2019


Probably works because a linked list doesn't necessarily need to consult
the list object itself when doing operations on subranges of it - it can
manipulate the nodes directly so it doesn't tend to matter what list those
nodes belong to.

& if it doesn't fail, inevitably someone'll accidentally rely on it.

An assert wouldn't be a bad thing, I think.

On Mon, Sep 16, 2019 at 1:53 AM Jonas Paulsson via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi,
>
> It has been discovered that SystemZTargetLowering::emitSelect() calls
> erase() on a range of instructions on the wrong MBB, without any assert
> triggering with seemingly correct behaviour (!). StartMBB->erase()
> should be JoinMBB->erase() since that's where the SelectPseudo(s) will
> reside.
>
> I am not sure why this "works" at the moment, or why there is not an
> assert checking for this. I made a patch to add asserts in erase() and
> remove() methods (attached), but found no other cases, though.
>
> Is there a reason this is not asserted in ilist?
>
> /Jonas
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190916/2b6ac77d/attachment.html>


More information about the llvm-dev mailing list