Issue 128322
Summary [MLIR]`-test-func-erase-result` triggers Assertion Failure `results.size() == 1 && "expected a single result type"'
Labels mlir
Assignees
Reporter xisang0
    Test on commit: https://github.com/llvm/llvm-project/commit/a9882bda96228ca23e166a817f93a7dbc99763cb
steps to reproduce:
```
mlir-opt test.mlir -test-func-erase-result
```
test case:
```
module {
  llvm.func @test_slice_invalid_start() { }
}
```
crash trace:
```
mlir-opt: /home/workdir/llvm-project-19/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp:235: LLVMFunctionType mlir::LLVM::LLVMFunctionType::clone(TypeRange, TypeRange) const: Assertion `results.size() == 1 && "expected a single result type"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: ./mlir-opt /home/workdir/test.mlir -test-func-erase-result
 #0 0x000060e47e21d998 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x108a998)
 #1 0x000060e47e21b4be llvm::sys::RunSignalHandlers() (./mlir-opt+0x10884be)
 #2 0x000060e47e21e3a8 SignalHandler(int) Signals.cpp:0:0
 #3 0x0000732c870b2520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x0000732c871069fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x0000732c870b2476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x0000732c870987f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x0000732c8709871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x0000732c870a9e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x000060e47f751836 mlir::LLVM::LLVMFunctionType::clone(mlir::TypeRange, mlir::TypeRange) const (./mlir-opt+0x25be836)
#10 0x000060e47f62ba2e mlir::detail::FunctionOpInterfaceInterfaceTraits::Model<mlir::LLVM::LLVMFuncOp>::cloneTypeWith(mlir::detail::FunctionOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::TypeRange, mlir::TypeRange) (./mlir-opt+0x2498a2e)
#11 0x000060e4813c87b6 mlir::FunctionOpInterface::getTypeWithoutResults(llvm::BitVector const&) (./mlir-opt+0x42357b6)
#12 0x000060e4813c84b0 (anonymous namespace)::TestFuncEraseResult::runOnOperation() TestFunc.cpp:0:0
#13 0x000060e4814ee3bf mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x435b3bf)
#14 0x000060e4814eeba2 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x435bba2)
#15 0x000060e4814f134e mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x435e34e)
#16 0x000060e4814e9e6b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#17 0x000060e4814e9acb 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
#18 0x000060e481592df5 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) (./mlir-opt+0x43ffdf5)
#19 0x000060e4814e49b2 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x43519b2)
#20 0x000060e4814e4c63 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x4351c63)
#21 0x000060e4814e4e72 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x4351e72)
#22 0x000060e47e1fcc27 main (./mlir-opt+0x1069c27)
#23 0x0000732c87099d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#24 0x0000732c87099e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#25 0x000060e47e1fc795 _start (./mlir-opt+0x1069795)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to