<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/118611>118611</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: d09707070c7460d0887eae8f7022e816510d5eb1
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_i128_i32(%arg0: vector<[1]x[1]xi128>, %arg1: memref<1x2x2xi128>) {
%c0 = arith.constant 0 : index
%c0_0 = arith.constant 0 : index
arm_sme.tile_store %arg0, %arg1[%c0_0, %c0_0] layout<horizontal> : memref<1x2x2xi128>, vector<[1]x[1]xi128>
return
}
}
```
stack trace:
```
mlir-opt: /data/szy/MLIR/llvm-release/llvm-project/mlir/lib/Conversion/ArmSMEToSCF/ArmSMEToSCF.cpp:36: SmallVector<Value, 2> (anonymous namespace)::getMemrefIndices(ValueRange, unsigned int, Value, Value, Location, PatternRewriter &): Assertion `(rank == 1 || rank == 2) && "memref has unexpected rank!"' 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/seed1/tmp.5OHJ322bT6.mlir
#0 0x000055d31395df88 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1185f88)
#1 0x000055d31395ba9e llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1183a9e)
#2 0x000055d31395e91d SignalHandler(int) Signals.cpp:0:0
#3 0x00007ff787ae6420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007ff78712300b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007ff787102859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
#6 0x00007ff787102729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
#7 0x00007ff787102729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
#8 0x00007ff787113fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#9 0x000055d31633d6a0 mlir::Value llvm::function_ref<mlir::Value (mlir::Value, mlir::ValueRange, mlir::Value, mlir::Value)>::callback_fn<(anonymous namespace)::TileLoadOpConversion::matchAndRewrite(mlir::arm_sme::TileLoadOp, mlir::PatternRewriter&) const::'lambda'(mlir::Value, mlir::ValueRange, mlir::Value, mlir::Value)>(long, mlir::Value, mlir::ValueRange, mlir::Value, mlir::Value) ArmSMEToSCF.cpp:0:0
#10 0x000055d31633cb4e (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 0x000055d31633f932 (anonymous namespace)::TileStoreOpConversion::matchAndRewrite(mlir::arm_sme::TileStoreOp, mlir::PatternRewriter&) const ArmSMEToSCF.cpp:0:0
#12 0x000055d3198b7a21 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 0x000055d3198b46eb 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+0x70dc6eb)
#14 0x000055d316df8a03 (anonymous namespace)::OperationLegalizer::legalize(mlir::Operation*, mlir::ConversionPatternRewriter&) DialectConversion.cpp:0:0
#15 0x000055d316df7a57 mlir::OperationConverter::convert(mlir::ConversionPatternRewriter&, mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x461fa57)
#16 0x000055d316df8c2f mlir::OperationConverter::convertOperations(llvm::ArrayRef<mlir::Operation*>) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x4620c2f)
#17 0x000055d316dfedeb mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x4626deb)
#18 0x000055d316340241 (anonymous namespace)::ConvertArmSMEToSCFPass::runOnOperation() ArmSMEToSCF.cpp:0:0
#19 0x000055d316d98936 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45c0936)
#20 0x000055d316d99260 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+0x45c1260)
#21 0x000055d316d9b832 mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45c3832)
#22 0x000055d316d940da performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#23 0x000055d316d93d2d 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 0x000055d316e3ffa5 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+0x4667fa5)
#25 0x000055d316d8dd15 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+0x45b5d15)
#26 0x000055d316d8dfbf mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45b5fbf)
#27 0x000055d316d8e2ee mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x45b62ee)
#28 0x000055d31393ea77 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1166a77)
#29 0x00007ff787104083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#30 0x000055d31393e5ee _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x11665ee)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWktv4zgS_jXMhYhBkXoecnA7MaYXCRIk2bkKlFiSuaPXklQ67l-_ICW_5CROd49nsIvth21RJVZ9VR-riqa51rJsAK5Q8AUF1xe8N6tWXX37tg69xLvIWrG-KqXBL6C0bBvE5liQJCL2bx75IREkjiPgEBcRoRRiLww8IgLIPETmiMz1Whuo7XMoJP_M-sb02ItnxJ-F-Pb5CYVkkFPQqVb0OeBv0qxG-bqS6rLtDMaXedu8gDKXXNWXuoZL017qvMB8ZmW2syAyH0fYHGM7EJLhn72oW9FXgFH0BZE5xkXf5DP7gpFPuKpTXUNqZAWpNq2CdNWqVHo0TiWjiMaIBlyVxM78ArlpFWILFHzxUHD9unm34ojdILrAg7hnxWuoFRSILbxX-kp3QsnWFGzFc4IRu8ZcSbOa5W2jDW8MtoNzLBsBr_ui6SeFR1yzHS68AbJnZPBlnHQcdB-Da1zxddsbxBarVsnvbWN4hdgN_gjU4rR3BssUmF419gJF1zZUw-skZtrw_A9sFM8BsfkbAhuOOMrQpeCGI7rU39eILu9uvz4iuqyql_pSQQVcw-ayU-2_IDeILh1d6LKSGaLLhaOZozpdzlX9dHfz3D4tlodXs7zrEJuz0Cp9qnlV_b7B_DuverBeoM5RNOZN26zrtte44TXozgKhicXC5iWYO-fGr42QOWhEY_f8I29KN0nfuOUpsGyMvd7Ovv1w2-bcOHMX-IEbA6p5hG9KGlAY0XBQhedag7JidlUhGive_GH5YynkYRQtULTA-4PUsdM-H2JE6RBsvOIa9w28dpAbEO4BRD1EKaIRLrisQMwQmT_c3syfbrDus1oazHHWl1hB1yqDTYtXxnTa4qfWq6U0qz6b5W09RuY4QFLr3vpmiXljPZFXvQBsVoBzxfUKZzz_wxHE6n5yfBF93Q10ITPs_jyot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