[clang] [HLSL][Matrix] Update indexed matrix elements individually (PR #176216)

Deric C. via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 16 11:51:50 PST 2026


================
@@ -2736,29 +2758,33 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src, LValue Dst,
       return;
     }
     if (Dst.isMatrixRow()) {
----------------
Icohedron wrote:

It should be possible, yes. But I think it is out of the scope of this PR.
The `Dst.isVectorElt()` case also has its own `if (getLangOpts().HLSL) { ... }` implementation nested in it, which is the format I replicated for this PR to handle `Dst.isMatrixElt()` and `Dst.isMatrixRow()` for HLSL (with `Dst.isMatrixRow()` just having an assert instead of an HLSL-specific if-block because no other language supports matrix single subscripting).

If we are to move refactor this code it should be done in a separate PR which takes care of all three cases at once for HLSL: `Dst.isVectorElt()`, `Dst.isMatrixElt()`, and `Dst.isMatrixRow()`

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


More information about the cfe-commits mailing list