[llvm-bugs] [Bug 37889] New: Assertion `std::any_of(GraphTraits<BlockT *>::child_begin(BB), GraphTraits<BlockT *>::child_end(BB), [&](BlockT *B) { return contains(B); }) && "Loop block has no in-loop successors!"' failed. with-simple-loop-unswitch -verify -loop-deletion

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 21 01:10:41 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37889

            Bug ID: 37889
           Summary: Assertion `std::any_of(GraphTraits<BlockT
                    *>::child_begin(BB), GraphTraits<BlockT
                    *>::child_end(BB), [&](BlockT *B) { return
                    contains(B); }) && "Loop block has no in-loop
                    successors!"' failed. with-simple-loop-unswitch
                    -verify -loop-deletion
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: mikael.holmen at ericsson.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 20454
  --> https://bugs.llvm.org/attachment.cgi?id=20454&action=edit
reproducer

Running

opt -S -o - bbi-14637_orig.ll -simple-loop-unswitch -verify -loop-deletion

gives

opt: ../include/llvm/Analysis/LoopInfoImpl.h:251: void
llvm::LoopBase<llvm::BasicBlock, llvm::Loop>::verifyLoop() const [BlockT =
llvm::BasicBlock, LoopT = llvm::Loop]: Assertion
`std::any_of(GraphTraits<BlockT *>::child_begin(BB), GraphTraits<BlockT
*>::child_end(BB), [&](BlockT *B) { return contains(B); }) && "Loop block has
no in-loop successors!"' failed.
Stack dump:
0.      Program arguments: opt -S -o - bbi-14637_orig.ll -simple-loop-unswitch
-verify -loop-deletion 
1.      Running pass 'Function Pass Manager' on module 'bbi-14637_orig.ll'.
2.      Running pass 'Loop Pass Manager' on function '@f1'
LLVMSymbolizer: error reading file: No such file or directory
#0 0x0000000001feeab4 (opt+0x1feeab4)
#1 0x0000000001fecd20 (opt+0x1fecd20)
#2 0x0000000001feee18 (opt+0x1feee18)
#3 0x00007fe98c849330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007fe98b438c37 gsignal
/build/eglibc-ripdx6/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007fe98b43c028 abort
/build/eglibc-ripdx6/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007fe98b431bf6 __assert_fail_base
/build/eglibc-ripdx6/eglibc-2.19/assert/assert.c:92:0
#7 0x00007fe98b431ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x0000000001520ea3 (opt+0x1520ea3)
#9 0x000000000152f59b (opt+0x152f59b)
#10 0x0000000001a79d4a (opt+0x1a79d4a)
#11 0x0000000001a79fa8 (opt+0x1a79fa8)
#12 0x0000000001a7a4dd (opt+0x1a7a4dd)
#13 0x00000000007454cc (opt+0x7454cc)
#14 0x00007fe98b423f45 __libc_start_main
/build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:321:0
#15 0x000000000072e82d (opt+0x72e82d)
Abort

This assertion started to trigger with r329047:

    [SCEV] Make computeExitLimit more simple and more powerful

and before that we instead get a failed assertion in SCEV

opt: ../lib/Analysis/ScalarEvolution.cpp:6948: ScalarEvolution::ExitLimit
llvm::ScalarEvolution::computeExitLimit(const llvm::Loop *, llvm::BasicBlock *,
bool): Assertion `BI->isConditional() && "If unconditional, it can't be in
loop!"' failed.

and this crash appears all the way back to when -simple-loop-unswitch was
introduced.

We're not normally using -simple-loop-unswitch when compiling for our
out-of-tree target but found this during fuzz testing using random passes.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180621/8ebd15ec/attachment.html>


More information about the llvm-bugs mailing list