Issue 173371
Summary mlir-opt crashes in OneShotModuleBufferize.cpp:139
Labels crash, mlir:bufferization
Assignees
Reporter Emilyaxe
    When running opt on the following IR, mlir-opt crashes. 

version 2c02e4c7909a

test.mlir

```
func.func @fmax_wrong_result_type(%arg0 : f64, %arg1 : f64) -> f64 {
  %result = "llvm.fmax" (%arg0, %arg1) : (f64, f64) -> f64
  llvm.return %result : f64
}


```


commads:

mlir-opt -eliminate-empty-tensors test.mlir

stacktrace

```
mlir-opt: llvm-project/mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp:139: LogicalResult (anonymous namespace)::aliasingFuncOpBBArgsAnalysis(FuncOp, OneShotAnalysisState &, FuncAnalysisState &): Assertion `!returnOps.empty() && "expected at least one ReturnOp"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.      Program arguments: ./bin/mlir-opt -eliminate-empty-tensors test.mlir
 #0 0x000055d6a5d6b358 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./bin/mlir-opt+0x1e97358)
 #1 0x000055d6a5d68a15 llvm::sys::RunSignalHandlers() (./bin/mlir-opt+0x1e94a15)
 #2 0x000055d6a5d6c396 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007f6dd4d06420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007f6dd435f00b raise /build/glibc-B3wQXB/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007f6dd433e859 abort /build/glibc-B3wQXB/glibc-2.31/stdlib/abort.c:81:7
 #6 0x00007f6dd433e729 get_sysdep_segment_value /build/glibc-B3wQXB/glibc-2.31/intl/loadmsgcat.c:509:8
 #7 0x00007f6dd433e729 _nl_load_domain /build/glibc-B3wQXB/glibc-2.31/intl/loadmsgcat.c:970:34
 #8 0x00007f6dd434ffd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #9 0x000055d6acf2d21d mlir::bufferization::analyzeModuleOp(mlir::Operation*, mlir::bufferization::OneShotAnalysisState&, mlir::bufferization::BufferizationStatistics*) (./bin/mlir-opt+0x905921d)
#10 0x000055d6acf11d70 mlir::bufferization::eliminateEmptyTensors(mlir::RewriterBase&, mlir::Operation*) (./bin/mlir-opt+0x903dd70)
#11 0x000055d6acf1202d (anonymous namespace)::EmptyTensorElimination::runOnOperation() EmptyTensorElimination.cpp:0:0
#12 0x000055d6ae4257be mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./bin/mlir-opt+0xa5517be)
#13 0x000055d6ae426617 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./bin/mlir-opt+0xa552617)
#14 0x000055d6ae42d9ca mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (./bin/mlir-opt+0xa5599ca)
#15 0x000055d6ae42d01f mlir::PassManager::run(mlir::Operation*) (./bin/mlir-opt+0xa55901f)
#16 0x000055d6a5e0f377 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#17 0x000055d6a5e0e5a6 llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, 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::MemoryBufferRef const&, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#18 0x000055d6ae740855 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::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (./bin/mlir-opt+0xa86c855)
#19 0x000055d6a5e04166 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./bin/mlir-opt+0x1f30166)
#20 0x000055d6a5e044a2 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./bin/mlir-opt+0x1f304a2)
#21 0x000055d6a5e04805 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./bin/mlir-opt+0x1f30805)
#22 0x000055d6a5d519b3 main (./bin/mlir-opt+0x1e7d9b3)
#23 0x00007f6dd4340083 __libc_start_main /build/glibc-B3wQXB/glibc-2.31/csu/../csu/libc-start.c:342:3
#24 0x000055d6a5d514ee _start (./bin/mlir-opt+0x1e7d4ee)
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to