llvm-project/clang/lib
Cullen Rhodes 89e61e782b [Sema][AArch64] Add semantics for arm_sve_vector_bits attribute
Summary:
This patch implements semantics for the 'arm_sve_vector_bits' type
attribute, defined by the Arm C Language Extensions (ACLE) for SVE [1].
The purpose of this attribute is to define fixed-length (VLST) versions
of existing sizeless types (VLAT).

Implemented in this patch is the the behaviour described in section 3.7.3.2
and minimal parts of sections 3.7.3.3 and 3.7.3.4, this includes:

    * Defining VLST globals, structs, unions, and local variables
    * Implicit casting between VLAT <=> VLST.
    * Diagnosis of ill-formed conditional expressions of the form:

        C ?  E1 : E2

      where E1 is a VLAT type and E2 is a VLST, or vice-versa. This
      avoids any ambiguity about the nature of the result type (i.e is
      it sized or sizeless).
    * For vectors:
        * sizeof(VLST) == N/8
        * alignof(VLST) == 16
    * For predicates:
        * sizeof(VLST) == N/64
        * alignof(VLST) == 2

VLSTs have the same representation as VLATs in the AST but are wrapped
with a TypeAttribute. Scalable types are currently emitted in the IR for
uses such as globals and structs which don't support these types, this
is addressed in the next patch with codegen, where VLSTs are lowered to
sized arrays for globals, structs / unions and arrays.

Not implemented in this patch is the behaviour guarded by the feature
macros:

    * __ARM_FEATURE_SVE_VECTOR_OPERATORS
    * __ARM_FEATURE_SVE_PREDICATE_OPERATORS

As such, the GNU __attribute__((vector_size)) extension is not available
and operators such as binary '+' are not supported for VLSTs. Support
for this is intended to be addressed by later patches.

[1] https://developer.arm.com/documentation/100987/latest

This is patch 2/4 of a patch series.

Reviewers: sdesmalen, rsandifo-arm, efriedma, cameron.mcinally, ctetreau, rengolin, aaron.ballman

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D83551
2020-07-22 16:26:23 +00:00
..
ARCMigrate With MSVC, file needs to be compiled with /BIGOBJ 2020-07-17 09:43:06 -07:00
AST [Sema][AArch64] Add semantics for arm_sve_vector_bits attribute 2020-07-22 16:26:23 +00:00
ASTMatchers Make helpers static. NFC. 2020-07-17 13:49:11 +02:00
Analysis [Analyzer] Report every bug if only uniqueing location differs. 2020-07-15 12:19:25 +02:00
Basic [OpenMP] Implement TR8 `present` map type modifier in Clang (1/2) 2020-07-22 10:15:32 -04:00
CodeGen Revert abd45154b "[Coverage] Add comment to skipped regions" 2020-07-22 17:09:20 +02:00
CrossTU [analyzer] Add CTUImportCppThreshold for C++ files 2020-07-09 15:36:33 +02:00
DirectoryWatcher [DirectoryWatcher] Do not use FSEvents on non-macOS platforms 2020-04-23 10:22:28 -07:00
Driver add -fpch-codegen/debuginfo mapping to -fmodules-codegen/debuginfo 2020-07-22 10:21:53 +02:00
Edit [C++2a] Add __builtin_bit_cast, used to implement std::bit_cast 2019-07-02 18:28:13 +00:00
Format [clang-format] Add BitFieldColonSpacing option 2020-07-20 20:55:51 +02:00
Frontend accept 'clang++ -c a.pch -o a.o' to create PCH's object file 2020-07-22 10:21:23 +02:00
FrontendTool [NFC] Refactor Registry loops to range for 2020-06-19 00:40:10 +01:00
Headers Fix pow and ldexp in HIP header 2020-07-21 17:39:46 -04:00
Index [openmp] Base of tablegen generated OpenMP common declaration 2020-06-23 10:32:32 -04:00
Lex Revert abd45154b "[Coverage] Add comment to skipped regions" 2020-07-22 17:09:20 +02:00
Parse [OpenMP] Implement TR8 `present` map type modifier in Clang (1/2) 2020-07-22 10:15:32 -04:00
Rewrite [Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug 2019-08-15 21:17:48 +00:00
Sema [Sema][AArch64] Add semantics for arm_sve_vector_bits attribute 2020-07-22 16:26:23 +00:00
Serialization Upgrade SmallSets of pointer-like types to SmallPtrSet 2020-07-20 16:54:29 +02:00
StaticAnalyzer [analyzer][solver] Track symbol disequalities 2020-07-22 13:02:39 +03:00
Testing Fix MSVC "not all control paths return a value" warning. NFC. 2020-06-05 10:45:59 +01:00
Tooling [libTooling] In Clang Transformer, change `Metadata` field to deferred evaluation. 2020-07-21 18:05:49 +00:00
CMakeLists.txt Move unittest helpers to a shared location 2020-05-29 16:47:33 +02:00