-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
Description
Boolean vectors are often lowered to integral operations. This code generates the expected bitwise operations only when avx512f
is available even though it does not require use of mask registers https://clang.godbolt.org/z/vrdbo9YKa.
#include <cstdint>
typedef __attribute__((ext_vector_type(16))) int16_t i16x16;
typedef __attribute__((ext_vector_type(16))) bool i1x16;
int A(i16x16);
void test(i16x16 v, i1x16 a, i1x16 b) {
i1x16 m = (a & (~b)) != 0;
if (__builtin_reduce_or(m))
A(v);
}
This is introduced at the first instruction selection phase, so I am guessing that lowering these is trying to use the mask registers which then get optimized away.