llvm-project
ecb980e5 - [mlir][VectorToSCF] Decline transfer ops with no automatic allocation scope (#216947)

Commit
3 days ago
[mlir][VectorToSCF] Decline transfer ops with no automatic allocation scope (#216947) Fixes #216225. Lowering a `vector.transfer_*` whose rank exceeds the target rank allocates a temporary buffer with `memref.alloca`, whose verifier requires an ancestor carrying `AutomaticAllocationScope`. The pattern never checked for one, so a transfer op sitting directly in `builtin.module` asserts in `getAutomaticAllocationScope` instead of being left alone: ```mlir %c0 = arith.constant 0 : index %cst = arith.constant dense<0.0> : vector<2x3xf32> %m = memref.alloc() : memref<2x3xf32> vector.transfer_write %cst, %m[%c0, %c0] : vector<2x3xf32>, memref<2x3xf32> ``` Declining is the only option: there is no legal IR the pattern could emit here. The check goes in `checkPrepareXferOp`, which both the read and the write conversion already call. Verified by execution: the input above aborts on `d4e78d7f5`, the new test fails without the patch and passes with it, and `Conversion/VectorToSCF` plus `Dialect/Vector` stay green (107 tests). Assisted-by: Claude (Anthropic) AI-assisted, disclosed per the LLVM AI Tool Use Policy.
Author
Parents
Loading