[cfe-dev] Scalar operand type has greater rank than the type of the vector element

Churaev, Egor via cfe-dev cfe-dev at lists.llvm.org
Tue Apr 25 06:51:23 PDT 2017


Hi all!

I attached test file. In the test we have diagnostic message with the following text: "scalar operand type has greater rank than the type of the vector element. ('float2' (vector of 2 'float' values) and 'double')".
If we run this test on the ToT then we get another diagnostic with the following message: "cannot convert between vector values of different size ('float2' (vector of 2 'float' values) and 'double')".

I think that the diagnostic on the ToT is wrong because in the code we don't have two vectors, we have one vector and one scalar. In the OpenCL V2.0 6.2.6.p2 is written that "An error shall occur if any scalar operand has greater rank than the type of the vector element.".
I have a patch where this diagnostic was implemented.
Should I commit this patch to ToT or it doesn't matter which diagnostic we will get in this case?

Best regards,
Egor


--------------------------------------------------------------------
Joint Stock Company Intel A/O
Registered legal address: Krylatsky Hills Business Park,
17 Krylatskaya Str., Bldg 4, Moscow 121614,
Russian Federation

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170425/8065730b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arithmetic-conversions.cl
Type: application/octet-stream
Size: 967 bytes
Desc: arithmetic-conversions.cl
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170425/8065730b/attachment.obj>


More information about the cfe-dev mailing list