<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64262>64262</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir] `affine-super-vectorize` Pass crashed with assertion failure "step has to be a positive integer constant"
</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 b4c54b20
Reproduced with:
`mlir-opt --affine-super-vectorize=virtual-vector-size=0 temp.mlir`
temp.mlir:
``` milr
module {
func.func nested @func2(%arg0: memref<21x12x12xi1>) {
affine.for %arg1 = 0 to 84 step 4294967295 {
}
return
}
}
```
trace:
```console
Assertion failed: (step > 0 && "step has to be a positive integer constant"), function build, file AffineOps.cpp, line 1898.
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-super-vectorize=virtual-vector-size=0 temp.mlir
#0 0x0000000103214548 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/workspace/build/bin/mlir-opt+0x1002f8548)
#1 0x00000001032127e4 llvm::sys::RunSignalHandlers() (/workspace/build/bin/mlir-opt+0x1002f67e4)
#2 0x0000000103214bf4 SignalHandler(int) (/workspace/build/bin/mlir-opt+0x1002f8bf4)
#3 0x00000001a46cd4c4 (/usr/lib/system/libsystem_platform.dylib+0x1803414c4)
#4 0x00000001a46b5ee0 (/usr/lib/system/libsystem_pthread.dylib+0x180329ee0)
#5 0x00000001a45f0340 (/usr/lib/system/libsystem_c.dylib+0x180264340)
#6 0x00000001a45ef754 (/usr/lib/system/libsystem_c.dylib+0x180263754)
#7 0x000000010703a880 mlir::affine::AffineForOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::ValueRange, mlir::AffineMap, mlir::ValueRange, mlir::AffineMap, long long, mlir::ValueRange, llvm::function_ref<void (mlir::OpBuilder&, mlir::Location, mlir::Value, mlir::ValueRange)>) (.cold.2) (/workspace/build/bin/mlir-opt+0x10411e880)
#8 0x000000010327f810 mlir::affine::AffineForOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::ValueRange, mlir::AffineMap, mlir::ValueRange, mlir::AffineMap, long long, mlir::ValueRange, llvm::function_ref<void (mlir::OpBuilder&, mlir::Location, mlir::Value, mlir::ValueRange)>) (/workspace/build/bin/mlir-opt+0x100363810)
#9 0x00000001032eb774 vectorizeOneOperation(mlir::Operation*, (anonymous namespace)::VectorizationState&) (/workspace/build/bin/mlir-opt+0x1003cf774)
#10 0x00000001032e9e40 mlir::WalkResult llvm::function_ref<mlir::WalkResult (mlir::Operation*)>::callback_fn<vectorizeLoopNest(std::__1::vector<llvm::SmallVector<mlir::affine::AffineForOp, 2u>, std::__1::allocator<llvm::SmallVector<mlir::affine::AffineForOp, 2u>>>&, mlir::affine::VectorizationStrategy const&)::$_3>(long, mlir::Operation*) (/workspace/build/bin/mlir-opt+0x1003cde40)
#11 0x00000001035b19d4 mlir::WalkResult mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<mlir::WalkResult (mlir::Operation*)>, mlir::WalkOrder) (/workspace/build/bin/mlir-opt+0x1006959d4)
#12 0x00000001032e83d8 vectorizeLoopNest(std::__1::vector<llvm::SmallVector<mlir::affine::AffineForOp, 2u>, std::__1::allocator<llvm::SmallVector<mlir::affine::AffineForOp, 2u>>>&, mlir::affine::VectorizationStrategy const&) (/workspace/build/bin/mlir-opt+0x1003cc3d8)
#13 0x00000001032e7cc0 vectorizeLoops(mlir::Operation*, llvm::DenseSet<mlir::Operation*, llvm::DenseMapInfo<mlir::Operation*, void>>&, llvm::ArrayRef<long long>, llvm::ArrayRef<long long>, llvm::DenseMap<mlir::Operation*, llvm::SmallVector<mlir::affine::LoopReduction, 2u>, llvm::DenseMapInfo<mlir::Operation*, void>, llvm::detail::DenseMapPair<mlir::Operation*, llvm::SmallVector<mlir::affine::LoopReduction, 2u>>> const&) (/workspace/build/bin/mlir-opt+0x1003cbcc0)
#14 0x00000001032ef4e8 (anonymous namespace)::Vectorize::runOnOperation() (/workspace/build/bin/mlir-opt+0x1003d34e8)
#15 0x000000010589de34 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/workspace/build/bin/mlir-opt+0x102981e34)
#16 0x000000010589e524 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/workspace/build/bin/mlir-opt+0x102982524)
#17 0x000000010589f5d8 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) (/workspace/build/bin/mlir-opt+0x1029835d8)
#18 0x000000010589df90 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/workspace/build/bin/mlir-opt+0x102981f90)
#19 0x000000010589e524 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/workspace/build/bin/mlir-opt+0x102982524)
#20 0x00000001058a03bc mlir::PassManager::run(mlir::Operation*) (/workspace/build/bin/mlir-opt+0x1029843bc)
#21 0x0000000105898808 performActions(llvm::raw_ostream&, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) (/workspace/build/bin/mlir-opt+0x10297c808)
#22 0x0000000105897d30 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+0x10297bd30)
#23 0x0000000105916be0 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+0x1029fabe0)
#24 0x00000001058926e4 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+0x1029766e4)
#25 0x0000000105892b54 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/workspace/build/bin/mlir-opt+0x102976b54)
#26 0x0000000102f1f58c main (/workspace/build/bin/mlir-opt+0x10000358c)
#27 0x000000010e7b9088
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWl1v2zrS_jXMDRGDIvVBXeTCTWq8AZo3QXJw9jKgpJHNLSVqSSqp99cvKNmxKcdp4vYcHBQNBEeiSM7MM89whpKEtXLZAlyg5BNKrs5E71baXFxqpXSnjestOSt0tb64-XJ9j4teKoeFw6VuGukwLuIyiQtKELlCZH4PndFVX0KFn6VbITbHeLyDUtIoac515_D5uahr2cK57Tsw509QOm3kfwGxqydpXC_Upu3cjq0EO2i6mZ8ApRtR4--unc1fBI0HbqQyeL9zo6teAUbZp_Ea47pvy5n_wS1YBxVGMfGXFFGOaCLMkngbGmgM1Ihd0uhbRP0hI8Q-I5rvT4bxaNas1gaPoyOM2BUm2GnMY2wddDimeZynGc2TcCz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