Open
Description
git version: d097070
system: Ubuntu 18.04.6 LTS
reproduce with: mlir-opt -lift-cf-to-scf a.mlir
a.mlir:
module {
func.func @reduce_i8(%arg0: vector<8xi8>) {
%0 = vector.reduction <add>, %arg0 : vector<8xi8> into i8
vector.print str "REDUCE I8:"
vector.print %0 :i8
return
^bb1(%1: i8):
%2 = arith.cmpi slt, %1, %0 : i8
spirv.BranchConditional %2, ^bb2(%1 : i8), ^bb3(%0 : i8)
^bb2(%3: i8):
vector.print str "REDUCE I8 #2, zeros,..."
vector.print %3 : i8
return
^bb3(%4: i8):
%5 = arith.cmpi slt, %4, %0 : i8
spirv.BranchConditional %5, ^bb1(%4 : i8), ^bb4(%0 : i8)
^bb4(%6: i8):
vector.print str "REDUCE I8 #2, #2,..."
vector.print %6 : i8
return
}
}
stack trace:
mlir-opt: /data/szy/MLIR/llvm-release/llvm-project/mlir/include/mlir/IR/UseDefLists.h:198: mlir::IRObjectWithUseList<mlir::BlockOperand>::~IRObjectWithUseList() [OperandType = mlir::BlockOperand]: Assertion `use_empty() && "Cannot destroy a value that still has uses!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt -lift-cf-to-scf /data/szy/MLIR/seed/seed4/tmp.pZsRF6nx9p.mlir
#0 0x000055cc0aea9f88 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1185f88)
#1 0x000055cc0aea7a9e llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1183a9e)
#2 0x000055cc0aeaa91d SignalHandler(int) Signals.cpp:0:0
#3 0x00007f0888283420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f08878c000b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f088789f859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
#6 0x00007f088789f729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
#7 0x00007f088789f729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
#8 0x00007f08878b0fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#9 0x000055cc0e3c5af9 (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x46a1af9)
#10 0x000055cc0e3c5efd mlir::Block::erase() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x46a1efd)
#11 0x000055cc0e32f754 mlir::transformCFGToSCF(mlir::Region&, mlir::CFGToSCFInterface&, mlir::DominanceInfo&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x460b754)
#12 0x000055cc0d91547f mlir::WalkResult llvm::function_ref<mlir::WalkResult (mlir::Operation*)>::callback_fn<(anonymous namespace)::LiftControlFlowToSCF::runOnOperation()::'lambda'(mlir::func::FuncOp)::operator()(mlir::func::FuncOp) const::'lambda'(mlir::Operation*)>(long, mlir::Operation*) ControlFlowToSCF.cpp:0:0
#13 0x000055cc0d91506e mlir::WalkResult llvm::function_ref<mlir::WalkResult (mlir::Operation*)>::callback_fn<std::enable_if<!llvm::is_one_of<mlir::func::FuncOp, mlir::Operation*, mlir::Region*, mlir::Block*>::value && std::is_same<mlir::WalkResult, mlir::WalkResult>::value, mlir::WalkResult>::type mlir::detail::walk<(mlir::WalkOrder)1, mlir::ForwardIterator, (anonymous namespace)::LiftControlFlowToSCF::runOnOperation()::'lambda'(mlir::func::FuncOp), mlir::func::FuncOp, mlir::WalkResult>(mlir::Operation*, (anonymous namespace)::LiftControlFlowToSCF::runOnOperation()::'lambda'(mlir::func::FuncOp)&&)::'lambda'(mlir::Operation*)>(long, mlir::Operation*) ControlFlowToSCF.cpp:0:0
#14 0x000055cc0afd5a27 mlir::WalkResult mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<mlir::WalkResult (mlir::Operation*)>, mlir::WalkOrder) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x12b1a27)
#15 0x000055cc0d914e07 (anonymous namespace)::LiftControlFlowToSCF::runOnOperation() ControlFlowToSCF.cpp:0:0
#16 0x000055cc0e2e4936 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45c0936)
#17 0x000055cc0e2e5260 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45c1260)
#18 0x000055cc0e2e7832 mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45c3832)
#19 0x000055cc0e2e00da performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#20 0x000055cc0e2dfd2d llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#21 0x000055cc0e38bfa5 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x4667fa5)
#22 0x000055cc0e2d9d15 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45b5d15)
#23 0x000055cc0e2d9fbf mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45b5fbf)
#24 0x000055cc0e2da2ee mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45b62ee)
#25 0x000055cc0ae8aa77 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1166a77)
#26 0x00007f08878a1083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#27 0x000055cc0ae8a5ee _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x11665ee)
``` /