[mlir][vector][spirv] Support lowering multi-dimensional vector.from_elements to SPIR-V
Background
https://github.com/llvm/llvm-project/pull/151175 supports lowering multi-dimensional vector.from_elements operations by first unrolling them to 1-D from_elements operations and then applying the 1-D vector.from_elements lowering pattern.
https://github.com/llvm/llvm-project/pull/142944 introduces a new canonicalization pattern that compresses a series of vector.insert operations into a single vector.from_elements operation.
Issues
The above two PRs work well for the LLVM backend, but, as this discussion said, we are uncertain whether UnrollFromElements work correctly for the SPIR-V backend. I attempted to verify this myself, but the lack of SPIR-V knowledge prevents me from making meaningful progress.
I would greatly appreciate if SPIR-V experts could help check whether the current implementation works correctly. If it doesn't work, please help implement the necessary SPIR-V lowering support. Thanks a lot.
@llvm/issue-subscribers-mlir
Author: Yang Bai (yangtetris)
https://github.com/llvm/llvm-project/pull/151175 supports lowering multi-dimensional vector.from_elements operations by first unrolling them to 1-D from_elements operations and then applying the 1-D vector.from_elements lowering pattern.
https://github.com/llvm/llvm-project/pull/142944 introduces a new canonicalization pattern that compresses a series of vector.insert operations into a single vector.from_elements operation.
Issues
The above two PRs work well for the LLVM backend, but, as this discussion said, we are uncertain whether UnrollFromElements work correctly for the SPIR-V backend. I attempted to verify this myself, but the lack of SPIR-V knowledge prevents me from making meaningful progress.
I would greatly appreciate if SPIR-V experts could help check whether the current implementation works correctly. If it doesn't work, please help implement the necessary SPIR-V lowering support. Thanks a lot.
CC @kuhar
@amd-eochoalo can you take a look?
@llvm/issue-subscribers-mlir-spirv
Author: Yang Bai (yangtetris)
https://github.com/llvm/llvm-project/pull/151175 supports lowering multi-dimensional vector.from_elements operations by first unrolling them to 1-D from_elements operations and then applying the 1-D vector.from_elements lowering pattern.
https://github.com/llvm/llvm-project/pull/142944 introduces a new canonicalization pattern that compresses a series of vector.insert operations into a single vector.from_elements operation.
Issues
The above two PRs work well for the LLVM backend, but, as this discussion said, we are uncertain whether UnrollFromElements work correctly for the SPIR-V backend. I attempted to verify this myself, but the lack of SPIR-V knowledge prevents me from making meaningful progress.
I would greatly appreciate if SPIR-V experts could help check whether the current implementation works correctly. If it doesn't work, please help implement the necessary SPIR-V lowering support. Thanks a lot.