[PATCH] D65286: [OpenCL] Allow OpenCL C style vector initialization in C++

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 25 08:58:40 PDT 2019


Anastasia created this revision.
Anastasia added reviewers: rjmccall, rsmith, mantognini.
Herald added subscribers: ebevhan, yaxunl.

I am recreating the review from https://reviews.llvm.org/D59426 that seem to get lost somehow.

The idea is to be able to allow creating vector literals from other vectors.

Example from reported bug `PR41010`

  kernel void test(__global float4 *out)
  {
      float4 a = (float4)(1.0f, 2.0f, 3.0f, 4.0f);
      float4 v = (float4)(a.s23, a.s01);
      *out = v;
  }

The primary use case is OpenCL but it can be used for vector extensions in plain C++ too.


https://reviews.llvm.org/D65286

Files:
  lib/Sema/SemaInit.cpp
  test/CodeGenOpenCL/vector_literals_valid.cl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65286.211765.patch
Type: text/x-patch
Size: 6179 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190725/d62ed79d/attachment-0001.bin>


More information about the cfe-commits mailing list