[clang] [llvm] [HLSL] Add matrix support to atan2 (PR #194984)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Sat May 9 08:52:54 PDT 2026


================
@@ -3232,10 +3232,13 @@ static bool CheckFloatRepresentation(Sema *S, SourceLocation Loc,
 static bool CheckFloatOrHalfRepresentation(Sema *S, SourceLocation Loc,
                                            int ArgOrdinal,
                                            clang::QualType PassedType) {
-  clang::QualType BaseType =
-      PassedType->isVectorType()
-          ? PassedType->castAs<clang::VectorType>()->getElementType()
-          : PassedType;
+  clang::QualType BaseType = PassedType;
+  if (const auto *VT = PassedType->getAs<clang::VectorType>()) {
+    BaseType = VT->getElementType();
+  } else if (const auto *MT = PassedType->getAs<clang::MatrixType>()) {
+    BaseType = MT->getElementType();
+  }
----------------
farzonl wrote:

llvm style guide is to not do brackets when we have one  line in scope
```suggestion
  if (const auto *VT = PassedType->getAs<clang::VectorType>())
    BaseType = VT->getElementType();
  else if (const auto *MT = PassedType->getAs<clang::MatrixType>())
    BaseType = MT->getElementType();
```

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


More information about the cfe-commits mailing list