[clang] [llvm] [HLSL][Matrix] Change MatrixSubscriptExpr flattened index to row major (PR #165666)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 30 00:37:00 PDT 2025


================
@@ -251,6 +251,19 @@ class MatrixBuilder {
     Value *NumRowsV = B.getIntN(MaxWidth, NumRows);
     return B.CreateAdd(B.CreateMul(ColumnIdx, NumRowsV), RowIdx);
   }
+
+  /// Compute the index to access the element at (\p RowIdx, \p ColumnIdx) from
+  /// a matrix with \p NumRows embedded in a vector.
----------------
farzonl wrote:

```suggestion
 /// a matrix with \p NumCols embedded in a vector.
```

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


More information about the cfe-commits mailing list