<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/118769>118769</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir] -convert-arm-sme-to-scf crashes
</td>
</tr>
<tr>
<th>Labels</th>
<td>
mlir
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
wwy6191
</td>
</tr>
</table>
<pre>
git version: adf892d743d91afc1af7893f97c770db31c26916
system: `Ubuntu 18.04.6 LTS`
reproduce with: `mlir-opt -convert-arm-sme-to-scf a.mlir`
a.mlir:
```
module {
func.func @arm_sme_tile_store_hor_i8(%arg0: vector<[4]x[4]xi32>, %arg1: memref<?x4xi8>) {
%c0 = arith.constant 0 : index
%c4 = arith.constant 4 : index
%c1 = arith.constant 1 : index
arm_sme.tile_store %arg0, %arg1[%c0] : memref<?x4xi8>, vector<[4]x[4]xi32>
return
}
}
```
stack trace:
```
mlir-opt: /data/szy/MLIR/llvm-release/llvm-project/llvm/include/llvm/ADT/STLExtras.h:1289: ReferenceT llvm::detail::indexed_accessor_range_base<mlir::ValueRange, llvm::PointerUnion<const mlir::Value *, mlir::OpOperand *, mlir::detail::OpResultImpl *>, mlir::Value, mlir::Value, mlir::Value>::operator[](size_t) const [DerivedT = mlir::ValueRange, BaseT = llvm::PointerUnion<const mlir::Value *, mlir::OpOperand *, mlir::detail::OpResultImpl *>, T = mlir::Value, PointerT = mlir::Value, ReferenceT = mlir::Value]: Assertion `Index < size() && "invalid index for value range"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt -convert-arm-sme-to-scf /data/szy/MLIR/seed/seed0/tmp.nhOYBm8G7S.mlir
#0 0x0000563b227fa048 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1188048)
#1 0x0000563b227f7b5e llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1185b5e)
#2 0x0000563b227fa9dd SignalHandler(int) Signals.cpp:0:0
#3 0x00007f499c231420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f499b86e00b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f499b84d859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
#6 0x00007f499b84d729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
#7 0x00007f499b84d729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
#8 0x00007f499b85efd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#9 0x0000563b251db6a2 (anonymous namespace)::getMemrefIndices(mlir::ValueRange, unsigned int, mlir::Value, mlir::Value, mlir::Location, mlir::PatternRewriter&) ArmSMEToSCF.cpp:0:0
#10 0x0000563b251dab8e (anonymous namespace)::createLoadStoreForOverTileSlices(mlir::PatternRewriter&, mlir::Location, mlir::VectorType, mlir::ValueRange, int, mlir::Value, mlir::Value, llvm::function_ref<mlir::Value (mlir::Value, mlir::ValueRange, mlir::Value, mlir::Value)>) ArmSMEToSCF.cpp:0:0
#11 0x0000563b251dd972 (anonymous namespace)::TileStoreOpConversion::matchAndRewrite(mlir::arm_sme::TileStoreOp, mlir::PatternRewriter&) const ArmSMEToSCF.cpp:0:0
#12 0x0000563b2875a851 void llvm::function_ref<void ()>::callback_fn<mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<llvm::LogicalResult (mlir::Pattern const&)>)::$_0>(long) PatternApplicator.cpp:0:0
#13 0x0000563b2875751b mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<llvm::LogicalResult (mlir::Pattern const&)>) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x70e551b)
#14 0x0000563b25c967d3 (anonymous namespace)::OperationLegalizer::legalize(mlir::Operation*, mlir::ConversionPatternRewriter&) DialectConversion.cpp:0:0
#15 0x0000563b25c95827 mlir::OperationConverter::convert(mlir::ConversionPatternRewriter&, mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x4623827)
#16 0x0000563b25c969ff mlir::OperationConverter::convertOperations(llvm::ArrayRef<mlir::Operation*>) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x46249ff)
#17 0x0000563b25c9cbbb mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x462abbb)
#18 0x0000563b251de281 (anonymous namespace)::ConvertArmSMEToSCFPass::runOnOperation() ArmSMEToSCF.cpp:0:0
#19 0x0000563b25c367a6 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45c47a6)
#20 0x0000563b25c370d0 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45c50d0)
#21 0x0000563b25c396a2 mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45c76a2)
#22 0x0000563b25c31f4a performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#23 0x0000563b25c31b9d 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
#24 0x0000563b25cddd75 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) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x466bd75)
#25 0x0000563b25c2bb85 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45b9b85)
#26 0x0000563b25c2be2f mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45b9e2f)
#27 0x0000563b25c2c15e mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45ba15e)
#28 0x0000563b227dab37 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1168b37)
#29 0x00007f499b84f083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#30 0x0000563b227da6ae _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x11686ae)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWttu4zjSfhrmhohBUeeLXCgH_3-ABAnizAB7JVAkJXNHorQklY776RekFB9kO073jKexix1M25FYYtVX9VWxKJpoLSrJ-RUIr0F4e0F6s2zV1bdvq8hLvYuiZaurShj4xpUWrQR-BgkrkxSzOPBZ6pGSeqSMk9Qv05jGMWKF71EcpV4EUAZQplfa8MY-ByL0W9FL00MvmaFgFsGH1wWI0CCneKda1lMOvwmzHOWbWqjLtjPwkrbyjStzSVRzqRt-adpLTUtIZlZkPQlA2XjHzyC0NyI0_G8vmpb1NYcgvgYog7DsJZ3ZDwgCRFST64bnRtQ816ZVPF-2KhcJwAnAIVEVsnO-cWpaBfwbEF4HILx9__gWPgb-HcA3cJD2rHTDG8VLK-3P34N3kTiRdG0BtMIUQeDfQqKEWc5oK7Uh0kB7M4NCMv6-JRocEg12Ra2cd0jO25tyBD3bgIYfWLeAhNfOShDewuOgbk66ZlCpuOmVdBcgvrURGj4nodKG0D-gUYRy4GcHBD6Y4YiC54wYAvBcf18BPH98uH8BeF7Xb82l4jUnmn9cdqr9J6dmvAR4LiSte8Y3N7LbV4Dni9eHu3ejiJ5ZKno4Sa2iF15yxSXlr9BJ-xnwM8YNEfXwt3MuZzmhlGvdqlwRWfG8sBb4NyMxgZ_9Tuqev9gx67nNXM-tkIar36RLtRsXOjh5DAKc2ac2t5-6p44rItn-0LZxT90L131t7puudpJD3CbTf_GWfzdctVazjbsrHwAnWnznubEsH6wH4fUtV-KNs1dHymNOuCaaDxK_1h0HrbQDozFHx7fIcUgivLUMyrTmyohW2up2b9kCgX8DrdNcoUkhwBHAEQQYC_lGasGGjIVlq-CbA6wGl2GAY1gSUXM2Ayh7frjLFndQ90UjDCSw6CuoeNcqA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