[llvm-bugs] [Bug 45355] New: opt -simple-loop-unswitch crashing with Assertion `llvm::find(Res, Child) == Res.end() && "Unexpected child found in the CFG"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 30 01:37:28 PDT 2020


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

            Bug ID: 45355
           Summary: opt -simple-loop-unswitch crashing with Assertion
                    `llvm::find(Res, Child) == Res.end() && "Unexpected
                    child found in the CFG"' failed.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: mikael.holmen at ericsson.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 23293
  --> https://bugs.llvm.org/attachment.cgi?id=23293&action=edit
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>
>::ChildrenGetter<false>::Get(llvm::DomTreeBuilder::SemiNCAInfo::NodePtr,
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 https://bugs.llvm.org/ 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)

-- 
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/20200330/1a7e9eaa/attachment-0001.html>


More information about the llvm-bugs mailing list