[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors

2021-05-17 Thread Ole Strohm via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG66b112d624a5: [OpenCL] Fix reinterpret_cast of vectors (authored by olestrohm). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101519/new/

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors

2021-05-14 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM! Thanks! Just remember to reflect your final change in the commit message description. :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101519/new/

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors

2021-05-14 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 345442. olestrohm added a comment. Fixed the code style and added some comments to the tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101519/new/ https://reviews.llvm.org/D101519 Files: clang/include/clang/Sema/Sema.h

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors

2021-05-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/Sema/SemaCast.cpp:2333 + if (DestType->isExtVectorType() || SrcType->isExtVectorType()) { +// FIXME: Allow for reinterpret cast between 3 and 4 element vectors +if (Self.areVectorTypesSameSize(SrcType,

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors

2021-05-11 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 344408. olestrohm added a comment. I tried to add a special case for 3 and 4 element vectors, but that caused issues in codgen, so I've left it as a FIXME for now. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101519/new/

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors

2021-05-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/test/SemaOpenCLCXX/reinterpret-cast.clcpp:15 + int4 i4; + auto i4_to_i3 = reinterpret_cast(i4); // expected-error{{reinterpret_cast from vector 'int4' (vector of 4 'int' values) to vector 'int3' (vector of 3 'int' values) of

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors

2021-05-07 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 343647. olestrohm retitled this revision from "[C++4OpenCL] Fix reinterpret_cast of vectors and types with address spaces" to "[C++4OpenCL] Fix reinterpret_cast of vectors". olestrohm set the repository for this revision to rG LLVM Github Monorepo.

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors and types with address spaces

2021-05-05 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/test/SemaOpenCLCXX/reinterpret-cast.clcpp:1 +// RUN: %clang_cc1 %s -pedantic -verify -fsyntax-only + olestrohm wrote: > Anastasia wrote: > > Btw I assume your patch also allows reinterpret_cast between vectors?

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors and types with address spaces

2021-04-30 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm added inline comments. Comment at: clang/test/SemaOpenCLCXX/reinterpret-cast.clcpp:1 +// RUN: %clang_cc1 %s -pedantic -verify -fsyntax-only + Anastasia wrote: > Btw I assume your patch also allows reinterpret_cast between vectors? What > happens if we

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors and types with address spaces

2021-04-30 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a subscriber: rjmccall. Anastasia added inline comments. Comment at: clang/lib/Sema/SemaCast.cpp:2352 + if (SrcType == DestType || + (Self.LangOpts.OpenCL && + Self.Context.removeAddrSpaceQualType(SrcType) == I am thinking of whether

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors and types with address spaces

2021-04-30 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm updated this revision to Diff 341844. olestrohm added a comment. Fixed formatting. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101519/new/ https://reviews.llvm.org/D101519 Files: clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaCast.cpp clang/lib/Sema/SemaExpr.cpp

[PATCH] D101519: [C++4OpenCL] Fix reinterpret_cast of vectors and types with address spaces

2021-04-29 Thread Ole Strohm via Phabricator via cfe-commits
olestrohm created this revision. olestrohm added reviewers: Anastasia, svenvh. olestrohm added a project: clang. Herald added subscribers: ldrumm, yaxunl. olestrohm requested review of this revision. Herald added a subscriber: cfe-commits. This fixes two issues with reinterpret_cast in C++ for