[clang] New __attribute__((__clang_arm_mve_strict_polymorphism)).
authorSimon Tatham <simon.tatham@arm.com>
Wed, 15 Jan 2020 14:07:04 +0000 (14:07 +0000)
committerSimon Tatham <simon.tatham@arm.com>
Wed, 15 Jan 2020 15:04:10 +0000 (15:04 +0000)
commitada01d1b869763f7d5d3438dcfce02066b06ab0a
treee05d0b64f46b0196af9c3ab13e27db17caefef4d
parent44f9c7a820c1e5fb949f441214a46b13588ff51a
[clang] New __attribute__((__clang_arm_mve_strict_polymorphism)).

This is applied to the vector types defined in <arm_mve.h> for use
with the intrinsics for the ARM MVE vector architecture.

Its purpose is to inhibit lax vector conversions, but only in the
context of overload resolution of the MVE polymorphic intrinsic
functions. This solves an ambiguity problem with polymorphic MVE
intrinsics that take a vector and a scalar argument: the scalar
argument can often have the wrong integer type due to default integer
promotions or unsuffixed literals, and therefore, the type of the
vector argument should be considered trustworthy when resolving MVE
polymorphism.

As part of the same change, I've added the new attribute to the
declarations generated by the MveEmitter Tablegen backend (and
corrected a namespace issue with the other attribute while I was
there).

Reviewers: aaron.ballman, dmgreen

Reviewed By: aaron.ballman

Subscribers: kristof.beyls, JDevlieghere, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D72518
clang/include/clang/Basic/Attr.td
clang/include/clang/Basic/AttrDocs.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/AST/TypePrinter.cpp
clang/lib/Sema/SemaOverload.cpp
clang/lib/Sema/SemaType.cpp
clang/test/Sema/overload-arm-mve.c [new file with mode: 0644]
clang/utils/TableGen/MveEmitter.cpp