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

    <tr>
        <th>Summary</th>
        <td>
            [mlir] Test-vector-transfer-full-partial-split Pass crashed with Assertion failure "Expected op to be inside automatic allocation scope"
        </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/a0dab4950
Reproduced with: 
`mlir-opt --test-vector-transfer-full-partial-split temp.mlir`

temp.mlir:
``` milr 
func.func @func(%arg0: tensor<?xf32>, %arg1: index, %arg2: vector<16xi1>) -> vector<16xf32> {
 %f0 = arith.constant 0.0 : f32
  %0 = vector.mask %arg2 { vector.transfer_read %arg0[%arg1], %f0 : tensor<?xf32>, vector<16xf32> } : vector<16xi1> -> vector<16xf32>
  return %0 : vector<16xf32>

```
 
trace:
```console  
Assertion failed: (scope && "Expected op to be inside automatic allocation scope"), function getAutomaticAllocationScope, file VectorTransferSplitRewritePatterns.cpp, line 457.
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 --test-vector-transfer-full-partial-split 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 0x00000001006186b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  mlir-opt                 0x0000000100617720 llvm::sys::RunSignalHandlers() + 112
2  mlir-opt 0x0000000100618d50 SignalHandler(int) + 344
3  libsystem_platform.dylib 0x00000001aad414c4 _sigtramp + 56
4  libsystem_pthread.dylib 0x00000001aad29ee0 pthread_kill + 288
5  libsystem_c.dylib 0x00000001aac64340 abort + 168
6  libsystem_c.dylib 0x00000001aac63754 err + 0
7  mlir-opt                 0x00000001022f76a8 mlir::vector::splitFullAndPartialTransfer(mlir::RewriterBase&, mlir::VectorTransferOpInterface, mlir::vector::VectorTransformsOptions, mlir::scf::IfOp*) (.cold.7) + 0
8  mlir-opt 0x00000001016c5ca8 mlir::vector::splitFullAndPartialTransfer(mlir::RewriterBase&, mlir::VectorTransferOpInterface, mlir::vector::VectorTransformsOptions, mlir::scf::IfOp*) + 5676
9  mlir-opt                 0x00000001016c634c mlir::vector::VectorTransferFullPartialRewriter::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const + 164
10 mlir-opt 0x0000000101f33b9c mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<mlir::LogicalResult (mlir::Pattern const&)>) + 1420
11 mlir-opt                 0x0000000101ce3918 mlir::applyPatternsAndFoldGreedily(llvm::MutableArrayRef<mlir::Region>, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig) + 3976
12 mlir-opt                 0x0000000101c69f44 (anonymous namespace)::TestVectorTransferFullPartialSplitPatterns::runOnOperation() + 312
13 mlir-opt                 0x0000000101c94428 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 428
14 mlir-opt 0x0000000101c94958 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
15 mlir-opt                 0x0000000101c989dc mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const + 176
16 mlir-opt                 0x0000000101c98858 mlir::LogicalResult mlir::failableParallelForEach<std::__1::__wrap_iter<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&>(mlir::MLIRContext*, std::__1::__wrap_iter<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*>, std::__1::__wrap_iter<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&) + 360
17 mlir-opt                 0x0000000101c95620 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) + 1396
18 mlir-opt                 0x0000000101c94558 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 732
19 mlir-opt 0x0000000101c94958 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
20 mlir-opt                 0x0000000101c962d4 mlir::PassManager::run(mlir::Operation*) + 1148
21 mlir-opt 0x0000000101c8f698 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
22 mlir-opt                 0x0000000101c8f268 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
23 mlir-opt                 0x0000000101cf9f5c 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
24 mlir-opt 0x0000000101c8d690 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
25 mlir-opt                 0x0000000101c8db84 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) + 1208
26 mlir-opt 0x00000001004baae4 main + 108
27 dyld 0x00000001056ad088 start + 516

```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWdtu4zjSfhrmhoghUQdLF7lQnOSfAAliJMEA_94YFFWyuU2RWpJKx_P0C4qSD7E94-5OLxqDaTQigypW1VdnitQYvpQAVyi5RsnNBe3sSumrmRJCtUrbzgQXparWV48P98-47LiwmFrMVNNwi1fWtgZFBSJ3iNwtuV115YSpBpE7Id7Gx2Wr1b-BWUTu_D5E7mhQ0TLOkwAFNygonqHVquoYVPgrtysUFdi_QGnQCK4vVWvx5aUFYy_fgFmlL62m0tSgL-tOiMuWasupuDSt4BZbaNqJ24fSQYD_u12Pig1__x83XOhBaN1JNnF_MIoD90QkQyShehk4zSxIozSKZii6e68jgqJbRGbYU4SOgssK3rdrxK15tVE0C9N3HvZ7cnyJotu9N54dRtNrr4rjUAcYRTeYam5XE6aksVRaHEzccoHdDk_qaD2p5zhpqPkyquBYjuuj6RYaaIVHZMn1iCC5GXSvvYgTgI_qfYOPgj2FdFRdg-20HBEUJyl7AfueGw3lPawpg0Pv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