[clang] [HLSL] Add matrix support for isnan() and isinf() (PR #195586)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 6 14:52:12 PDT 2026


================
@@ -558,6 +558,17 @@ static Value *emitGetDimensions(CodeGenFunction &CGF, const CallExpr *E,
   return LastStore;
 }
 
+static llvm::Type *getAggregateType(llvm::Type *ScalarTy, QualType ArgTy) {
+  if (auto *MatTy = ArgTy->getAs<ConstantMatrixType>())
+    return llvm::VectorType::get(
+        ScalarTy,
+        ElementCount::getFixed(MatTy->getNumRows() * MatTy->getNumColumns()));
----------------
farzonl wrote:

the prefered way to do this is `getNumElementsFlattened()`

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


More information about the cfe-commits mailing list