[PATCH] D48617: [Builtins][Attributes][X86] Tag all X86 builtins with their required vector width. Add a min_vector_width function attribute and tag all x86 instrinsics with it.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 27 10:34:29 PDT 2018


aaron.ballman added a reviewer: aaron.ballman.
aaron.ballman added inline comments.


================
Comment at: include/clang/Basic/Attr.td:1949
+  let Args = [UnsignedArgument<"VectorWidth">];
+  let Subjects = SubjectList<[Function], ErrorDiag>;
+  let Documentation = [Undocumented];
----------------
Should this apply to Objective-C methods? What about other function-like interfaces such as function pointers?


================
Comment at: include/clang/Basic/Attr.td:1950
+  let Subjects = SubjectList<[Function], ErrorDiag>;
+  let Documentation = [Undocumented];
+}
----------------
No new, undocumented attributes, please.


================
Comment at: lib/Sema/SemaDeclAttr.cpp:2955
+  if (Existing && Existing->getVectorWidth() != VecWidth)
+    S.Diag(AL.getLoc(), diag::warn_duplicate_attribute) << AL.getName();
+
----------------
Do you want to drop one of the attributes in this case?


================
Comment at: test/Sema/attr-min-vector-width.c:8
+
+void f3(void) __attribute__((__min_vector_width__(128), __min_vector_width__(256))); /* expected-warning {{attribute '__min_vector_width__' is already applied with different parameters}} */
----------------
Also missing tests for applying the attribute to the wrong subject and with the incorrect number of arguments.


https://reviews.llvm.org/D48617





More information about the cfe-commits mailing list