[clang] [llvm] [DXIL] implement dot intrinsic lowering for integers (PR #85662)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 19 07:26:09 PDT 2024


================
@@ -5484,6 +5484,19 @@ bool CheckFloatOrHalfRepresentations(Sema *S, CallExpr *TheCall) {
                                   checkFloatorHalf);
 }
 
+bool CheckNoDoubleVectors(Sema *S, CallExpr *TheCall) {
+  auto checkDoubleVector = [](clang::QualType PassedType) -> bool {
+    if (PassedType->isVectorType() && PassedType->hasFloatingRepresentation()) {
+      clang::QualType BaseType =
+          PassedType->getAs<clang::VectorType>()->getElementType();
----------------
llvm-beanz wrote:

```suggestion
    if (const auto *VecTy = dyn_cast<VectorType>(PassedType)) {
      clang::QualType BaseType = VecTy->getElementType();
```
nit: `hasFloatingRepresentation` does the `dyn_cast` to `VectorType` and inspects the element type. It's probably more streamlined for this case since we care about a specific element type to just do the `dyn_cast` and check inline.

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


More information about the cfe-commits mailing list