<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64979>64979</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir] `affine-loop-tile` pass crashed with assertion error "Align can't be 0."
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Colloportus0
</td>
</tr>
</table>
<pre>
MLIR built at commit 5624e86a
Reproduced with:
`mlir-opt --affine-loop-tile=cache-size=0 temp.mlir`
```module {
func.func private @func1(%arg0: index) -> memref<11x5xf32> {
%cst_1 = arith.constant 0x4DAB5ADE : f32
%cst_2 = arith.constant 1.840000e+04 : f16
%false = arith.constant false
%c7 = arith.constant 7 : index
%c8 = arith.constant 8 : index
%c15 = arith.constant 15 : index
%c16 = arith.constant 16 : index
%c26 = arith.constant 26 : index
%7 = tensor.empty(%c7, %c16) : tensor<?x?x28xi16>
%124 = affine.for %arg1 = 0 to 92 iter_args(%arg2 = %7) -> (tensor<?x?x28xi16>) {
%325 = tensor.empty(%c26, %c15) : tensor<?x?x28xi16>
affine.yield %325 : tensor<?x?x28xi16>
}
%alloc_34 = memref.alloc() : memref<11x5xf32>
return %alloc_34 : memref<11x5xf32>
}
}
```
```console
Assertion failed: (Align != 0u && "Align can't be 0."), function alignTo, file MathExtras.h, line 378.
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 --affine-loop-tile=cache-size=0 temp.mlir
#0 0x000000010038b774 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/workspace/build/bin/mlir-opt+0x1002f7774)
#1 0x0000000100389910 llvm::sys::RunSignalHandlers() (/workspace/build/bin/mlir-opt+0x1002f5910)
#2 0x000000010038be3c SignalHandler(int) (/workspace/build/bin/mlir-opt+0x1002f7e3c)
#3 0x00000001b0a454c4 (/usr/lib/system/libsystem_platform.dylib+0x1803414c4)
#4 0x00000001b0a2dee0 (/usr/lib/system/libsystem_pthread.dylib+0x180329ee0)
#5 0x00000001b0968340 (/usr/lib/system/libsystem_c.dylib+0x180264340)
#6 0x00000001b0967754 (/usr/lib/system/libsystem_c.dylib+0x180263754)
#7 0x00000001043f2fec (anonymous namespace)::LoopTiling::runOnOperation() (.cold.14) (/workspace/build/bin/mlir-opt+0x10435efec)
#8 0x0000000100459e30 (anonymous namespace)::LoopTiling::runOnOperation() (/workspace/build/bin/mlir-opt+0x1003c5e30)
#9 0x0000000102ba8ecc mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/workspace/build/bin/mlir-opt+0x102b14ecc)
#10 0x0000000102ba95bc mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/workspace/build/bin/mlir-opt+0x102b155bc)
#11 0x0000000102baa670 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) (/workspace/build/bin/mlir-opt+0x102b16670)
#12 0x0000000102ba9028 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/workspace/build/bin/mlir-opt+0x102b15028)
#13 0x0000000102ba95bc mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/workspace/build/bin/mlir-opt+0x102b155bc)
#14 0x0000000102bab474 mlir::PassManager::run(mlir::Operation*) (/workspace/build/bin/mlir-opt+0x102b17474)
#15 0x0000000102ba36d8 performActions(llvm::raw_ostream&, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) (/workspace/build/bin/mlir-opt+0x102b0f6d8)
#16 0x0000000102ba2c00 mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_1>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) (/workspace/build/bin/mlir-opt+0x102b0ec00)
#17 0x0000000102c300c8 mlir::splitAndProcessBuffer(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) (/workspace/build/bin/mlir-opt+0x102b9c0c8)
#18 0x0000000102b9d5b4 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/workspace/build/bin/mlir-opt+0x102b095b4)
#19 0x0000000102b9da24 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/workspace/build/bin/mlir-opt+0x102b09a24)
#20 0x0000000100096d40 main (/workspace/build/bin/mlir-opt+0x100002d40)
#21 0x000000010c041088
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWVtvIjsS_jXmxQpy23194IEJQTvSRImSeUdudzV4x2332u4zsL9-5W4INIGcCTp70WijJEC7Ll9VfS5f4M7JtQaYoeQLShYT3vmNsbN7o5RpjfWdI5PSVLvZ47evL7jspPKYeyxM00iPcZLSGPKUI7JAZP4CrTVVJ6DCP6XfIDbHeBhBKWm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