[Mlir-commits] [mlir] [mlir][VectorToGPU] Only convert an scf.yield that terminates an scf.for (PR #218226)

Alessandro Potenza llvmlistbot at llvm.org
Mon Aug 24 08:46:42 PDT 2026


alepot55 wrote:

Good question, and it turns out the nvgpu path needs the guard just as much. I built both arms at `294c9c8b3` rather than reason about it, two `mlir-opt` binaries with distinct md5s, `d27e18f40da3` and `89f261ed8654`, on the same reduced case:

| pipeline | baseline | with the guard |
|---|---|---|
| `convert-vector-to-gpu` | `rc=134`, `Assertion isa<To>(Val)`, `To = mlir::scf::ForOp` | `rc=0`, the `scf.if` is left alone |
| `convert-vector-to-gpu{use-nvgpu=true}` | `rc=134`, same assertion, same `To` | `rc=0`, the `scf.if` is left alone |

The reason it is the same crash is that both entry points dispatch a yield to the same helper: `convertVectorToMMAOps` has `else if (auto yieldOp = dyn_cast<scf::YieldOp>(op)) res = convertYieldOp(...)`, and `convertVectorToNVVMCompatibleMMASync` has `.Case([&](scf::YieldOp yieldOp) { return convertYieldOp(...); })`. One `cast<scf::ForOp>`, two ways in.

So the check is valid for `useNvGpu = true`, and it was worth asking, because the PR only covered one of the two. I have pushed a matching case into `vector-to-mma-ops-mma-sync.mlir`, and the existing file still passes on its own RUN line.

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


More information about the Mlir-commits mailing list