[Mlir-commits] [mlir] [mlir][SPIRV] Fix lookup logic `spirv.target_env` for `gpu.module` (PR #147262)
Jakub Kuderski
llvmlistbot at llvm.org
Tue Jul 8 07:32:42 PDT 2025
kuhar wrote:
> If target env is inserted via the `spirv-attach-target` pass when no op—including `builtin.module` or `gpu.module`—has an existing one, then under the current implementation, the target env is attached only to the `"targets"` array attribute of `gpu.module`, and does not appear elsewhere.
> When the `convert-gpu-to-spirv` pass is run in this case, it fails to find the target env in `"targets"` and instead falls back to the default target env, which leads to a legalization failure of the `memref.load` op.
To me the sounds like the wrong fix. Could we teach the passes you mentioned to also look in `"targets"` instead of relying on the core `lookupTargetEnv` helper that doesn't know anything about the `gpu` dialect?
https://github.com/llvm/llvm-project/pull/147262
More information about the Mlir-commits
mailing list