[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.

Chandler Carruth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 2 13:24:49 PDT 2018


chandlerc added a comment.

FWIW, I looked at an early version of this patch and am generally happy with the target-specific / IR-specific behavior aspects of it. Totally leaving the detailed review of the attribute stuff to you Aaron, as you're already doing an amazing job there. Minor clarification on use cases below.



================
Comment at: include/clang/Basic/Attr.td:1949
+  let Args = [UnsignedArgument<"VectorWidth">];
+  let Subjects = SubjectList<[Function], ErrorDiag>;
+  let Documentation = [Undocumented];
----------------
aaron.ballman wrote:
> craig.topper wrote:
> > aaron.ballman wrote:
> > > Should this apply to Objective-C methods? What about other function-like interfaces such as function pointers?
> > I think maybe it should apply to objective-C. but I"m not sure because it doesn't look like the target attribute applies there?
> I don't have strong opinions on the question, I just wasn't sure if this attribute would be something an ObjC method would want to make use of. If that's unlikely, it's reasonable to leave it off until a use case appears.
Should it in theory? Yes.

But if/when we want to make good on that in practice, we would need to do the same for the target attribute as Craig mentions. I think it would be good to defer doing anything here to that point -- we don't need these to be *more* powerful than the target attribute in that regard.


https://reviews.llvm.org/D48617





More information about the cfe-commits mailing list