[cfe-dev] incorrect IR representation for bool GCC vectors

Anton Yartsev anton.yartsev at gmail.com
Fri Oct 29 20:24:41 PDT 2010


Hi all,

i have found out that IR representation of bool vectors is incorrect. 
The following code

typedef bool v128b __attribute__ ((vector_size (16)));
int main() {
   v128b v1;
}

gives

define i32 @main() nounwind {
entry:
   %v1 = alloca <16 x i1>, align 16
   ret i32 0
}

<16 x i1> is insufficient for 16-byte vector.
GCC docs(http://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html) say 
nothing about bool as base vector type but GCC accepts the above code.
I guess the correct representation should be either <128 x i1>  or <16 x 
i8>..  Or maybe bool vectors should be prohibited?
Any thoughts?

Submitted to bugzilla: http://llvm.org/bugs/show_bug.cgi?id=8512

-- 
Anton




More information about the cfe-dev mailing list