================
@@ -2259,9 +2256,8 @@ Value 
*ScalarExprEmitter::VisitMatrixSubscriptExpr(MatrixSubscriptExpr *E) {
   Value *Idx;
   unsigned NumCols = MatrixTy->getNumColumns();
   unsigned NumRows = MatrixTy->getNumRows();
-  bool IsMatrixRowMajor =
-      isMatrixRowMajor(CGF.getLangOpts(), E->getBase()->getType());
-  Idx = MB.CreateIndex(RowIdx, ColumnIdx, NumRows, NumCols, IsMatrixRowMajor);
+  Idx = MB.CreateIndex(RowIdx, ColumnIdx, NumRows, NumCols,
+                       /*IsRowMajor=*/false);
----------------
farzonl wrote:

Its a good question and the reason why this test is failing right now 
https://github.com/llvm/llvm-project/blob/fbf3c11ccd65fee37c80c9c00c0c4ab638388fe0/clang/test/CodeGen/matrix-type-indexing.c#L18-L30

I introduced this row major\column major toggling behavior to c\c++. Before I 
did that `MB.CreateIndex` default behavior was column major. I think it might 
be easer for c\c++ to do what we are now doing for HLSL and just updat the 
tests to show that matrix indexing will be stable across row\column major but 
row major will account for that with transpose operations.

So TLDR yes it was intentional, i'm fixing an issue I created in c\c++ myself.

https://github.com/llvm/llvm-project/pull/225519
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to