[PATCH] D111986: [Clang] Add elementwise abs builtin.

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 26 09:50:04 PDT 2021


fhahn added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8754
+def err_elementwise_math_invalid_arg_type_2: Error <
+  "argument must have a %0 type, but was %1">;
+
----------------
aaron.ballman wrote:
> I feel like we must already have a diagnostic that covers this case...
Updated to use `err_builtin_invalid_arg_type`.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:16547
+  Expr *A = TheCall->getArg(0);
+  QualType TyA = A->getType();
+
----------------
aaron.ballman wrote:
> Should this type undergo the usual promotions?
I'm not sure, but given that we only have a single argument then wouldn't it be sufficient to avoid promotion? I don't think promotion to wider types would impact the results of the provided builtins.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111986



More information about the cfe-commits mailing list