| Issue |
202782
|
| Summary |
[mlir][bufferization] mlir-opt crashes with Assertion `memref::CastOp::areCastCompatible(srcType, destType) && "expected that types are cast compatible"' failed.
|
| Labels |
|
| Assignees |
|
| Reporter |
Aran-414
|
git version: d33b8093ce336b92d01f55033aed7021f5244eec
MLIR Program:
```mlir
#map = affine_map<(d0) -> (d0 + 7)>
module {
func.func @test_to_buffer(%arg0: tensor<?xi64>, %arg1: tensor<*xi64>) -> (memref<?xi64, #map>, memref<*xi64, 1>) {
%0 = bufferization.to_buffer %arg0 : tensor<?xi64> to memref<?xi64, #map>
%1 = bufferization.to_buffer %arg1 : tensor<*xi64> to memref<*xi64, 1>
return %0, %1 : memref<?xi64, #map>, memref<*xi64, 1>
}
}
```
Reproduce Command: `mlir-opt -sparsification-and-bufferization a.mlir`
StackTrace:
```
mlir-opt: /data2/dependency/dev/llvm-project/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp:125: llvm::LogicalResult mlir::bufferization::foldToBufferToTensorPair(mlir::RewriterBase&, mlir::bufferization::ToBufferOp, const mlir::bufferization::BufferizationOptions&): Assertion `memref::CastOp::areCastCompatible(srcType, destType) && "expected that types are cast compatible"' 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: /data2/dependency/dev/llvm-project/build/bin/mlir-opt -sparsification-and-bufferization a.mlir
#0 0x000056522fed4bcf llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x25ccbcf)
#1 0x000056522fed129c llvm::sys::RunSignalHandlers() (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x25c929c)
#2 0x000056522fed1437 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007f47ac402420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f47abeed00b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#5 0x00007f47abecc859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#6 0x00007f47abecc729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
#7 0x00007f47abeddfd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#8 0x00005652372e6912 (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x99de912)
#9 0x000056523725e670 mlir::bufferization::bufferizeOp(mlir::Operation*, mlir::bufferization::BufferizationOptions const&, mlir::bufferization::BufferizationState&, mlir::bufferization::BufferizationStatistics*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x9956670)
#10 0x00005652372b3fba mlir::bufferization::bufferizeModuleOp(mlir::Operation*, mlir::bufferization::OneShotBufferizationOptions const&, mlir::bufferization::BufferizationState&, mlir::bufferization::BufferizationStatistics*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x99abfba)
#11 0x0000565230c8b159 mlir::sparse_tensor::SparsificationAndBufferizationPass::runDenseBufferization() (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x3383159)
#12 0x0000565230c8bac4 mlir::sparse_tensor::SparsificationAndBufferizationPass::runOnOperation() (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x3383ac4)
#13 0x0000565238c68f01 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb360f01)
#14 0x0000565238c69290 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb361290)
#15 0x0000565238c6b344 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb363344)
#16 0x0000565238c6c3d1 mlir::PassManager::run(mlir::Operation*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb3643d1)
#17 0x000056522ff9c3cb performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#18 0x000056522ff9ce73 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, mlir::SourceMgrDiagnosticVerifierHandler*, llvm::ThreadPoolInterface*) MlirOptMain.cpp:0:0
#19 0x000056522ff9d0fb 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&)::'lambda'(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef, llvm::raw_ostream&)>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#20 0x0000565239047e45 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) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb73fe45)
#21 0x000056522ff92f54 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (.part.0) MlirOptMain.cpp:0:0
#22 0x000056522ff9d617 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x2695617)
#23 0x000056522ff9d853 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x2695853)
#24 0x000056522fdd2adc main (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x24caadc)
#25 0x00007f47abece083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#26 0x000056522feb10ce _start (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x25a90ce)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs