<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 - opt -simple-loop-unswitch crashing with Assertion `llvm::find(Res, Child) == Res.end() && "Unexpected child found in the CFG"' failed."
   href="https://bugs.llvm.org/show_bug.cgi?id=45355">45355</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>opt -simple-loop-unswitch crashing with Assertion `llvm::find(Res, Child) == Res.end() && "Unexpected child found in the CFG"' failed.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>Scalar Optimizations
          </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=23293" name="attach_23293" title="bbi-40855_2.ll reproducer">attachment 23293</a> <a href="attachment.cgi?id=23293&action=edit" title="bbi-40855_2.ll reproducer">[details]</a></span>
bbi-40855_2.ll reproducer

Reproduce with:
 opt -S -o - bbi-40855_2.ll -simple-loop-unswitch 

Result:

opt: ../include/llvm/Support/GenericDomTreeConstruction.h:160: static
llvm::DomTreeBuilder::SemiNCAInfo::ChildrenGetter::ResultTy
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false>
<span class="quote">>::ChildrenGetter<false>::Get(llvm::DomTreeBuilder::SemiNCAInfo::NodePtr,</span >
llvm::DomTreeBuilder::SemiNCAInfo::BatchUpdatePtr) [DomTreeT =
llvm::DominatorTreeBase<llvm::BasicBlock, false>, Inverse = false]: Assertion
`llvm::find(Res, Child) == Res.end() && "Unexpected child found in the CFG"'
failed.
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace.
Stack dump:
0.      Program arguments: ../../master/llvm/build-all-builtins/bin/opt -S -o -
bbi-40855_2.ll -simple-loop-unswitch 
1.      Running pass 'Function Pass Manager' on module 'bbi-40855_2.ll'.
2.      Running pass 'Loop Pass Manager' on function '@f'
3.      Running pass 'Simple unswitch loops' on basic block '%for.cond1'
 #0 0x000000000429aa64 PrintStackTraceSignalHandler(void*)
(../../master/llvm/build-all-builtins/bin/opt+0x429aa64)
 #1 0x000000000429862e llvm::sys::RunSignalHandlers()
(../../master/llvm/build-all-builtins/bin/opt+0x429862e)
 #2 0x000000000429ae6c SignalHandler(int)
(../../master/llvm/build-all-builtins/bin/opt+0x429ae6c)
 #3 0x00007f62ef76c890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #4 0x00007f62ee215e97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #5 0x00007f62ee217801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #6 0x00007f62ee20739a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #7 0x00007f62ee207412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #8 0x0000000003a8fbf4
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::ChildrenGetter<false>::Get(llvm::BasicBlock*,
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::BatchUpdateInfo*)
(../../master/llvm/build-all-builtins/bin/opt+0x3a8fbf4)
 #9 0x0000000003a8645c
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::DeleteEdge(llvm::DominatorTreeBase<llvm::BasicBlock, false>&,
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::BatchUpdateInfo*, llvm::BasicBlock*, llvm::BasicBlock*)
(../../master/llvm/build-all-builtins/bin/opt+0x3a8645c)
#10 0x0000000003aa1a6c
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::ApplyNextUpdate(llvm::DominatorTreeBase<llvm::BasicBlock, false>&,
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::BatchUpdateInfo&)
(../../master/llvm/build-all-builtins/bin/opt+0x3aa1a6c)
#11 0x0000000003a8765b
llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock,
false> >::ApplyUpdates(llvm::DominatorTreeBase<llvm::BasicBlock, false>&,
llvm::ArrayRef<llvm::cfg::Update<llvm::BasicBlock*> >)
(../../master/llvm/build-all-builtins/bin/opt+0x3a8765b)
#12 0x0000000004190c2f unswitchAllTrivialConditions(llvm::Loop&,
llvm::DominatorTree&, llvm::LoopInfo&, llvm::ScalarEvolution*,
llvm::MemorySSAUpdater*)
(../../master/llvm/build-all-builtins/bin/opt+0x4190c2f)
#13 0x00000000041ab169 (anonymous
namespace)::SimpleLoopUnswitchLegacyPass::runOnLoop(llvm::Loop*,
llvm::LPPassManager&) (../../master/llvm/build-all-builtins/bin/opt+0x41ab169)
#14 0x000000000344bddb llvm::LPPassManager::runOnFunction(llvm::Function&)
(../../master/llvm/build-all-builtins/bin/opt+0x344bddb)
#15 0x0000000003af5374 llvm::FPPassManager::runOnFunction(llvm::Function&)
(../../master/llvm/build-all-builtins/bin/opt+0x3af5374)
#16 0x0000000003af5628 llvm::FPPassManager::runOnModule(llvm::Module&)
(../../master/llvm/build-all-builtins/bin/opt+0x3af5628)
#17 0x0000000003af5c7d llvm::legacy::PassManagerImpl::run(llvm::Module&)
(../../master/llvm/build-all-builtins/bin/opt+0x3af5c7d)
#18 0x0000000002370d9f main
(../../master/llvm/build-all-builtins/bin/opt+0x2370d9f)
#19 0x00007f62ee1f8b97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#20 0x000000000235b02a _start
(../../master/llvm/build-all-builtins/bin/opt+0x235b02a)
Abort (core dumped)</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>