[clang] [HLSL][Matrix] Allow flattening matrix types in FlattenAccessAndTypeLValue (PR #177708)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 27 12:45:56 PST 2026


================
@@ -7194,8 +7194,8 @@ void CodeGenFunction::FlattenAccessAndTypeLValue(
       // Matrices are represented as flat arrays in memory, but has a vector
       // value type. So we use ConvertMatrixAddress to convert the address from
       // array to vector, and extract elements similar to the vector case above.
-      // The order in which we iterate over the elements must respect the
-      // matrix memory layout, computing the proper index for each (row, col).
+      // The matrix elements are iterated over in row-major order regardless of
----------------
farzonl wrote:

The comment seems weird to me because its essentially saying yes keep using the first index as a the row and the second index as the column.

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


More information about the cfe-commits mailing list