[Mlir-commits] [mlir] [mlir][ArmSME] Skip tile allocation for functions with no SME tile values (PR #227153)

Benjamin Maxwell llvmlistbot at llvm.org
Thu Oct 1 02:22:14 PDT 2026


================

----------------
MacDue wrote:

Ah not in this case. The allocator is clever enough to sink the `get_tile` ops into the branches (as they have no side effects) which mean both can be assigned the same tile ID. To reproduce the error you need to add some ops that can't be sunk (e.g. a load_slice):

```mlir
func.func @overlapping_branches(%cond: i1, %src : memref<?x?xi8>, %mask : vector<[16]xi1>) {
  %tile = arm_sme.get_tile : vector<[16]x[16]xi8>
  %c0 = arith.constant 0 : index
  %c1 = arith.constant 1 : index
  %vecA = arm_sme.load_tile_slice %src[%c0], %mask, %tile, %c0 : memref<?x?xi8>, vector<[16]xi1>, vector<[16]x[16]xi8>
  %vecB = arm_sme.load_tile_slice %src[%c0], %mask, %tile, %c1 : memref<?x?xi8>, vector<[16]xi1>, vector<[16]x[16]xi8>
  %ret = scf.if %cond -> vector<[16]x[16]xi8> {
    scf.yield %vecA : vector<[16]x[16]xi8>
  } else {
    scf.yield %vecB : vector<[16]x[16]xi8>
  }
  "test.some_use"(%ret) : (vector<[16]x[16]xi8>) -> ()
  return
}
```

https://github.com/llvm/llvm-project/pull/227153


More information about the Mlir-commits mailing list