This patch implements codegen 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 lowering of VLSTs to valid types.
VLSTs (unlike VLATs) can be used in globals, members of structs
and unions, and arrays. To support this in this patch we lower VLSTs to
arrays. For example, in the following C code:
#if __ARM_FEATURE_SVE_BITS==512 typedef svint32_t fixed_svint32_t __attribute__((arm_sve_vector_bits(512))); struct struct_int32 { fixed_int32_t x; } struct_int32; #endif
the struct is lowered to:
%struct.struct_int32 = type { [16 x i32] }
where the member 'x' is a fixed-length variant of 'svint32_t' that
contains exactly 512 bits.
When loading from a VLST to a VLAT, or when storing a VLAT to a VLST,
the address is bitcasted, e.g.
bitcast [N x i8]* %addr.ptr to <vscale x 16 x i8>*
Patch contains changes by Cullen Rhodes and Sander de Smalen.
Do we need to bitcast the result of CreateTempAlloca to a pointer to the array type? I'm concerned that we might miss a bitcast if the source code uses the address of the variable.