<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="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"
   href="https://bugs.llvm.org/show_bug.cgi?id=37889">37889</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>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
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mikael.holmen@ericsson.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20454" name="attach_20454" title="reproducer">attachment 20454</a> <a href="attachment.cgi?id=20454&action=edit" title="reproducer">[details]</a></span>
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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>