This commit prevents warnings from -Wconversion when a clang vector type
is implicitly converted to a sizeless builtin type -- for example, when
implicitly converting a fixed-predicate to a scalable predicate.
The code below:
1 #include <arm_sve.h> 2 3 #define N __ARM_FEATURE_SVE_BITS 4 #define FIXED_ATTR __attribute__((arm_sve_vector_bits (N))) 5 typedef svbool_t fixed_svbool_t FIXED_ATTR; 6 7 inline fixed_svbool_t foo(fixed_svbool_t p) { 8 return svnot_z(svptrue_b64(), p); 9 }
would previously raise this warning:
warning: implicit conversion turns vector to scalar: \ 'fixed_svbool_t' (vector of 8 'unsigned char' values) to 'svbool_t' \ (aka '__SVBool_t') [-Wconversion]
Note that many cases of these implicit conversions were already
permitted because many functions inside arm_sve.h are spawned via
preprocessor macros, and the call to isInSystemMacro would cover us in
this case. This commit fixes the remaining cases.
I suppose we could tighten this further by replacing isSizelessBuiltinType with isVLSTBuiltinType