[PATCH] D114688: [Clang] Add __builtin_elementwise_ceil

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 1 07:39:14 PST 2021


fhahn added inline comments.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:2104
+            TheCall, [this](QualType ArgTy, SourceLocation ArgLoc) -> bool {
+              QualType EltTy = ArgTy;
+              if (auto *VecTy = EltTy->getAs<VectorType>())
----------------
Could you add a comment at the top of the function, saying that this restricts the element type to signed integers or floating point types?


================
Comment at: clang/lib/Sema/SemaChecking.cpp:2117
+            TheCall, [this](QualType ArgTy, SourceLocation ArgLoc) -> bool {
+              QualType EltTy = ArgTy;
+              if (auto *VecTy = EltTy->getAs<VectorType>())
----------------
Could you add a comment here saying that this restricts the element type to floating point types only?


================
Comment at: clang/lib/Sema/SemaChecking.cpp:16728
+  if (checkMathBuiltinElementType(*this, ArgLoc, TyA) ||
+      ExtraCheck(TyA, ArgLoc))
     return true;
----------------
Could you swap the `TyA` and `ArgLoc` arguments to the function, so it is consistent with the earlier call to `checkMathBuiltinElementType`? (Something I missed when I posted the suggestion)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114688/new/

https://reviews.llvm.org/D114688



More information about the cfe-commits mailing list