[PATCH] D15721: [Sema] Fix ICE on casting a vector of bools to a vector of T

George Burgess IV via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 25 16:47:52 PST 2016


george.burgess.iv added a comment.

> I am generally not clear about the scope of this patch. Is it intended for OpenCL or C++?


Sorry for the lack of clarity; I was mildly confused about what parts of the OpenCL spec apply to extended vectors when compiling code as C/C++. I think I have a better understanding of the split now. :) More directly, this is targeted at extended vectors in C/C++.

After playing around and asking on IRC, it seems that, when compiled as C/C++, extended vectors are intended to allow more operations than they do in OpenCL. Specifically, we have test cases for an extended vector of `bool`s (see test/CodeGen/convertvector.c), and we have test cases for casting between extended vector types (see test/Sema/ext_vector_casts.cpp).

Hopefully the revised patch is a bit more clear, as well.


================
Comment at: test/CodeGenCXX/bool-vector-conversion.cpp:8
@@ +7,3 @@
+
+// Nothing but OpenCL allows vectors of booleans.
+// CHECK-LABEL: @_Z4testv
----------------
Anastasia wrote:
> Can you explain why? Table 6.2 doesn't list it among allowed valid types and Table 6.4 only says it's a reserved data type, but doesn't allow to use in application code anyways (Section 6.1.4).
Marking this as done because I don't think this needs to conform to the OpenCL spec when compiling as C/C++, and we have test cases that use extended vectors of `bool`s in C/C++.


http://reviews.llvm.org/D15721





More information about the cfe-commits mailing list