<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59970>59970</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [mlir] Sparse Vectorization Pass failed with assertion failure "vectorLength > 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 https://github.com/llvm/llvm-project/commit/a0138390
Reproduced with: 
`mlir-opt --sparse-vectorization temp.mlir`

temp.mlir:
```mlir 
  func.func @func()  {
    %c4 = arith.constant 4 : index
 %alloc = memref.alloc(%c4) {alignment = 4096 : i64} : memref<?xf32>
 return 
  }

```
 
trace:
```console 

Assertion failed: (vectorLength > 0), function populateSparseVectorizationPatterns, file SparseVectorization.cpp, line 671.
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 --sparse-vectorization temp.mlir
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mlir-opt 0x0000000104aa85bc llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  mlir-opt                 0x0000000104aa7624 llvm::sys::RunSignalHandlers() + 112
2  mlir-opt 0x0000000104aa8c54 SignalHandler(int) + 344
3  libsystem_platform.dylib 0x00000001867854c4 _sigtramp + 56
4  libsystem_pthread.dylib 0x000000018676dee0 pthread_kill + 288
5  libsystem_c.dylib 0x00000001866a8340 abort + 168
6  libsystem_c.dylib 0x00000001866a7754 err + 0
7  mlir-opt                 0x0000000106233530 mlir::populateSparseVectorizationPatterns(mlir::RewritePatternSet&, unsigned int, bool, bool) (.cold.2) + 0
8  mlir-opt 0x0000000105455fd0 mlir::populateSparseVectorizationPatterns(mlir::RewritePatternSet&, unsigned int, bool, bool) + 1576
9  mlir-opt                 0x0000000105445600 (anonymous namespace)::SparseVectorizationPass::runOnOperation() + 152
10 mlir-opt                 0x0000000105cb34dc mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 420
11 mlir-opt 0x0000000105cb3a0c mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
12 mlir-opt                 0x0000000105cb5388 mlir::PassManager::run(mlir::Operation*) + 1148
13 mlir-opt 0x0000000105cae840 performActions(llvm::raw_ostream&, bool, bool, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, bool, bool) + 504
14 mlir-opt                 0x0000000105cae410 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>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool)::$_0>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) + 704
15 mlir-opt                 0x0000000105d1902c 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) + 656
16 mlir-opt 0x0000000105cac838 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool) + 216
17 mlir-opt                 0x0000000105cacd2c mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) + 1208
18 mlir-opt 0x000000010494b0a0 main + 108
19 dyld 0x0000000109421088 start + 516
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWFtv2zgW_jX0C1GDokRdHvzg3DAFEiRIigF2XwyKOpa5pUgtSaX1_PoFKfmWOFvPoMAWizGCSCDP9TsXHpE7J1sNsEDsCrGbGR_8xtjFtVHK9Mb6wZFZbZrt4uH-8zOuB6k85h4L03XS4433vUPpEtE7RO9a6TdDPRemQ_ROqdfd41Nvzb9AeETvRj5E7zhJ0jKtCCI3iCyfobemGQQ0-Jv0G5Qu8biBctIpaT-Z3uNPn1zPrYNPryC8sfIP7qXR2EPXzwMRyidp4__DerrcCxv_wuqkAOP1oMU8_MMoI-GJaIlohTEqrnY0GCPKRIZReoO5lX4zF0Y7z7XHYXGJpW7g-0SNKONKGRGpO-gsrOdxIQpmIgvSUXHFlWx1B9pHwoxU-Sgqz1BxE19HZpReo_Tu-zqlKL2ddFjwg9V7H1Bxc-z63tGdRSMglgt4D0bwxCjAxwKWzoGN6K65VNDEgNByBP4edOs3GKW3mCBaIXodMYzkvekHxT28xEj9fhyoJ-49WO0ivVSAz9DMRd-HfSU14LxI5qM5T_e3y5db7IY6JB3H9dBiCyE9sTd_PgmlcwM4RO8w1w2WWqihAew3gIXlboNrLr5GsCb1L56Lr7gZun6PHpnj-HuyprW8w9y2Qwili2G7OGPfiI_JbwaP3barjcKad-AC8KDdYAFvzYA3_BVwdGgkkn-AxVKHPYufll9-w8ZiBz76A_pVWjMm2Su3GOXk_v73h9XLPx6uHu8___P2eRVYUE4CkL2ROiIaKrQ6-IoPHpHvZP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