-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Labels
Description
git version: adf892d
system: Ubuntu 18.04.6 LTS
reproduce with: mlir-opt -inline a.mlir
a.mlir:
module {
llvm.func @test_muli() -> i64 attributes {llvm.emit_c_interface} {
"test.foo"() : () -> ()
}
llvm.func @_mlir_ciface_test_muli() -> i64 attributes {llvm.emit_c_interface} {
%0 = llvm.call @test_muli() : () -> i64
llvm.return %0 : i64
}
}
stack trace:
/data/szy/MLIR/seed/seed0/tmp.mRO4z47uRO.mlir:6:10: error: 'llvm.call' op operation destroyed but still has uses
%0 = llvm.call @test_muli() : () -> i64
^
/data/szy/MLIR/seed/seed0/tmp.mRO4z47uRO.mlir:6:10: note: see current operation: %0 = "llvm.call"() <{CConv = #llvm.cconv<ccc>, TailCallKind = #llvm.tailcallkind<none>, callee = @test_muli, fastmathFlags = #llvm.fastmath<none>, op_bundle_sizes = array<i32>, operandSegmentSizes = array<i32: 0, 0>}> : () -> i64
/data/szy/MLIR/seed/seed0/tmp.mRO4z47uRO.mlir:7:5: note: - use: "llvm.return"(<<UNKNOWN SSA VALUE>>) : (i64) -> ()
llvm.return %0 : i64
^
LLVM ERROR: operation destroyed but still has uses
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 -inline /data/szy/MLIR/seed/seed0/tmp.mRO4z47uRO.mlir
#0 0x000055e94c826048 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1188048)
#1 0x000055e94c823b5e llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1185b5e)
#2 0x000055e94c8269dd SignalHandler(int) Signals.cpp:0:0
#3 0x00007f6d36298420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f6d358d500b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f6d358b4859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
#6 0x000055e94c846017 llvm::report_fatal_error(llvm::Twine const&, bool) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x11a8017)
#7 0x000055e94c845e36 (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x11a7e36)
#8 0x000055e94fe06b7d mlir::Operation::~Operation() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x4768b7d)
#9 0x000055e94fe0efb2 llvm::iplist_impl<llvm::simple_ilist<mlir::Operation>, llvm::ilist_traits<mlir::Operation>>::erase(llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, true, false, void, false, void>, false, false>) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x4770fb2)
#10 0x000055e94fce1169 mlir::Inliner::doInlining() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x4643169)
#11 0x000055e94fc88d5f (anonymous namespace)::InlinerPass::runOnOperation() InlinerPass.cpp:0:0
#12 0x000055e94fc627a6 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45c47a6)
#13 0x000055e94fc630d0 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+0x45c50d0)
#14 0x000055e94fc656a2 mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45c76a2)
#15 0x000055e94fc5df4a performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#16 0x000055e94fc5db9d 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
#17 0x000055e94fd09d75 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+0x466bd75)
#18 0x000055e94fc57b85 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+0x45b9b85)
#19 0x000055e94fc57e2f mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45b9e2f)
#20 0x000055e94fc5815e mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45ba15e)
#21 0x000055e94c806b37 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1168b37)
#22 0x00007f6d358b6083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#23 0x000055e94c8066ae _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x11686ae)