[Mlir-commits] [mlir] [mlir][vector] ND vectors linearization pass (PR #81159)

Ivan Butygin llvmlistbot at llvm.org
Thu Feb 8 14:14:15 PST 2024


Hardcode84 wrote:

In our case underlying API/ABI (SPIR-V intrinsics) expects 1D vectors, but it interprets them as ND and we represent them (and surrounding arith ops) as ND at the intermediate steps, so we need to linearize it at some point. Also, vector unrolling and linearization are not mutually exclusive. We can have some partial unroll first and than run linearization on result (and potentially, some legalization pass after, breaking big 1D vectors into smaller ones, supported by HW). Regarding loads/stores and similar potentially non-linearizable ops, they are not covered by the patch and will stay untouched + `shape_cast`, but we can unroll them and reconstruct linear vector if we cannot statically determine they are safe.

I understand this transform is quite usecase-specific, so don't want to force it into default vector/llvm/spir-v pipeline.

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


More information about the Mlir-commits mailing list