-
Notifications
You must be signed in to change notification settings - Fork 391
Open
Labels
ReducerRelated to `circt-reduce`Related to `circt-reduce`bugSomething isn't workingSomething isn't working
Description
This issue can be reproduced by the attached mlirbc and circt-reduce built at 40962a3. An easy fix can be introduced to guard the isBeforeInBlock, but I think it exposes a deeper issue with other passes.
Stacktrace:
circt-reduce: /scratch/tianruiwei/tmp/circt/llvm/mlir/lib/IR/Operation.cpp:387: bool mlir::Operation::isBeforeInBlock(mlir::Operation*): Assertion `other && other->block == block && "Expected other operation to have the same parent block."' failed.
PLEASE submit a bug report to https://github.com/llvm/circt and include the crash backtrace.
Stack dump:
0. Program arguments: circt-reduce merged.mlirbc -keep-best -o Reduced.mlirbc --exclude=canonicalize -emit-bytecode -test=test.sh
#0 0x000060e2ebc0bfb9 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /scratch/tianruiwei/tmp/circt/llvm/llvm/lib/Support/Unix/Signals.inc:838:3
#1 0x000060e2ebc08f84 llvm::sys::RunSignalHandlers() /scratch/tianruiwei/tmp/circt/llvm/llvm/lib/Support/Signals.cpp:104:20
#2 0x000060e2ebc0979c SignalHandler(int, siginfo_t*, void*) /scratch/tianruiwei/tmp/circt/llvm/llvm/lib/Support/Unix/Signals.inc:426:14
#3 0x00007dc195a3e540 (/usr/lib/libc.so.6+0x3e540)
#4 0x00007dc195a9894c (/usr/lib/libc.so.6+0x9894c)
#5 0x00007dc195a3e410 raise (/usr/lib/libc.so.6+0x3e410)
#6 0x00007dc195a2557a abort (/usr/lib/libc.so.6+0x2557a)
#7 0x00007dc195a254e3 __assert_perror_fail (/usr/lib/libc.so.6+0x254e3)
#8 0x000060e2ebb9abb2 llvm::ilist_traits<mlir::Operation>::addNodeToList(mlir::Operation*) (.cold) /scratch/tianruiwei/tmp/circt/llvm/mlir/lib/IR/Operation.cpp:502:74
#9 0x000060e2ec9ccec0 (anonymous namespace)::ConnectForwarder::match(mlir::Operation*) /scratch/tianruiwei/tmp/circt/lib/Dialect/FIRRTL/FIRRTLReductions.cpp:935:17
#10 0x000060e2ebbca324 circt::Reduction::matches(mlir::Operation*, llvm::function_ref<void (unsigned long, unsigned long)>) /scratch/tianruiwei/tmp/circt/include/circt/Reduce/Reduction.h:52:13
#11 0x000060e2ebbca324 operator() /scratch/tianruiwei/tmp/circt/tools/circt-reduce/circt-reduce.cpp:278:24
#12 0x000060e2ebbca324 void llvm::function_ref<void (mlir::Operation*)>::callback_fn<execute(mlir::MLIRContext&)::'lambda0'(mlir::Operation*)>(long, mlir::Operation*) /scratch/tianruiwei/tmp/circt/llvm/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:52
#13 0x000060e2ebbcd198 llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, true, false, void, false, void>, false, false>::operator++() /scratch/tianruiwei/tmp/circt/llvm/llvm/include/llvm/ADT/ilist_iterator.h:187:13
#14 0x000060e2ebbcd198 llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, true, false, void, false, void>, false, false>::operator++(int) /scratch/tianruiwei/tmp/circt/llvm/llvm/include/llvm/ADT/ilist_iterator.h:197:5
#15 0x000060e2ebbcd198 llvm::early_inc_iterator_impl<llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, true, false, void, false, void>, false, false>>::operator*() /scratch/tianruiwei/tmp/circt/llvm/llvm/include/llvm/ADT/STLExtras.h:599:22
#16 0x000060e2ebbcd198 void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) /scratch/tianruiwei/tmp/circt/llvm/mlir/include/mlir/IR/Visitors.h:145:7
#17 0x000060e2ebbcd198 llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, true, false, void, false, void>, false, false>::operator++() /scratch/tianruiwei/tmp/circt/llvm/llvm/include/llvm/ADT/ilist_iterator.h:187:13
#18 0x000060e2ebbcd198 llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, true, false, void, false, void>, false, false>::operator++(int) /scratch/tianruiwei/tmp/circt/llvm/llvm/include/llvm/ADT/ilist_iterator.h:197:5
#19 0x000060e2ebbcd198 llvm::early_inc_iterator_impl<llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, true, false, void, false, void>, false, false>>::operator*() /scratch/tianruiwei/tmp/circt/llvm/llvm/include/llvm/ADT/STLExtras.h:599:22
#20 0x000060e2ebbcd198 void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) /scratch/tianruiwei/tmp/circt/llvm/mlir/include/mlir/IR/Visitors.h:145:7
#21 0x000060e2ebbcd198 llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, true, false, void, false, void>, false, false>::operator++() /scratch/tianruiwei/tmp/circt/llvm/llvm/include/llvm/ADT/ilist_iterator.h:187:13
#22 0x000060e2ebbcd198 llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, true, false, void, false, void>, false, false>::operator++(int) /scratch/tianruiwei/tmp/circt/llvm/llvm/include/llvm/ADT/ilist_iterator.h:197:5
#23 0x000060e2ebbcd198 llvm::early_inc_iterator_impl<llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, true, false, void, false, void>, false, false>>::operator*() /scratch/tianruiwei/tmp/circt/llvm/llvm/include/llvm/ADT/STLExtras.h:599:22
#24 0x000060e2ebbcd198 void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) /scratch/tianruiwei/tmp/circt/llvm/mlir/include/mlir/IR/Visitors.h:145:7
#25 0x000060e2ebbc319a llvm::SmallVectorBase<unsigned int>::size() const /scratch/tianruiwei/tmp/circt/llvm/llvm/include/llvm/ADT/SmallVector.h:79:32
#26 0x000060e2ebbc319a llvm::SmallVectorTemplateCommon<Match, void>::end() /scratch/tianruiwei/tmp/circt/llvm/llvm/include/llvm/ADT/SmallVector.h:270:41
#27 0x000060e2ebbc319a decltype(fp.end()) std::end<llvm::SmallVector<Match, 16u>>(llvm::SmallVector<Match, 16u>&) /usr/include/c++/15.2.1/bits/range_access.h:80:24
#28 0x000060e2ebbc319a decltype(end(forward<llvm::SmallVector<Match, 16u>&>(fp))) llvm::adl_detail::end_impl<llvm::SmallVector<Match, 16u>&>(llvm::SmallVector<Match, 16u>&) /scratch/tianruiwei/tmp/circt/llvm/llvm/include/llvm/ADT/ADL.h:37:13
#29 0x000060e2ebbc319a decltype(end_impl(forward<llvm::SmallVector<Match, 16u>&>(fp))) llvm::adl_end<llvm::SmallVector<Match, 16u>&>(llvm::SmallVector<Match, 16u>&) /scratch/tianruiwei/tmp/circt/llvm/llvm/include/llvm/ADT/ADL.h:88:30
#30 0x000060e2ebbc319a stable_sort<llvm::SmallVector<Match, 16>&, execute(mlir::MLIRContext&)::<lambda(auto:51&, auto:52&)> > /scratch/tianruiwei/tmp/circt/llvm/llvm/include/llvm/ADT/STLExtras.h:2044:19
#31 0x000060e2ebbc319a execute /scratch/tianruiwei/tmp/circt/tools/circt-reduce/circt-reduce.cpp:288:24
#32 0x000060e2ebbc319a main /scratch/tianruiwei/tmp/circt/tools/circt-reduce/circt-reduce.cpp:532:14
#33 0x00007dc195a27675 (/usr/lib/libc.so.6+0x27675)
#34 0x00007dc195a27729 __libc_start_main (/usr/lib/libc.so.6+0x27729)
#35 0x000060e2ebbc7f95 _start (/scratch/tianruiwei/tmp/circt/build/bin/circt-reduce+0x1cef95)
Aborted (core dumped) circt-reduce merged.mlirbc -keep-best -o Reduced.mlirbc --exclude=canonicalize -emit-bytecode -test=test.sh
Metadata
Metadata
Assignees
Labels
ReducerRelated to `circt-reduce`Related to `circt-reduce`bugSomething isn't workingSomething isn't working