[clang] [HLSL][Matrix] Add APValue and ConstExpr evaluator support for matrices (PR #178762)

Tex Riddell via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 30 14:48:47 PST 2026


================
@@ -4122,6 +4135,22 @@ static bool flattenAPValue(EvalInfo &Info, const Expr *E, APValue Value,
       }
       continue;
     }
+    if (Work.isMatrix()) {
+      assert(Type->isConstantMatrixType() && "Type mismatch.");
+      const auto *MT = Type->castAs<ConstantMatrixType>();
+      QualType ElTy = MT->getElementType();
+      // Matrix elements are flattened in row-major order.
----------------
tex3d wrote:

I didn't feel strongly about it, so that's fine.

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


More information about the cfe-commits mailing list