[PATCH] D115960: Revert D109159 "[amdgpu] Enable selection of `s_cselect_b64`."

2022-01-05 Thread David Salinas via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG859ebca744e6: Revert D109159 [amdgpu] Enable selection 
of `s_cselect_b64`. (authored by david-salinas).
Herald added subscribers: cfe-commits, libcxx-commits, lldb-commits, 
Sanitizers, luke957, abrachet, ormris, dang, jdoerfert, sstefan1, phosek, 
usaxena95, pengfei, s.egerton, asbirlea, mstorsjo, lebedev.ri, kadircet, 
rupprecht, arphaman, steven_wu, mgrang, simoncook, fedor.sergeev, krytarowski, 
arichardson, mgorny, emaste, dschuff.
Herald added a reviewer: lebedev.ri.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: jhenderson.
Herald added projects: clang, Sanitizers, LLDB, libc++, lld-macho, 
clang-tools-extra.
Herald added a reviewer: libc++.
Herald added a reviewer: lld-macho.

Changed prior to commit:
  https://reviews.llvm.org/D115960?vs=395475=397626#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115960/new/

https://reviews.llvm.org/D115960

Files:
  clang-tools-extra/clangd/unittests/TestScheme.h
  clang/lib/Driver/ToolChains/HIP.cpp
  clang/lib/Driver/ToolChains/HIP.h
  clang/test/CodeGen/Inputs/sanitizer-blacklist-vfsoverlay.yaml
  clang/test/CodeGen/catch-alignment-assumption-blacklist.c
  clang/test/CodeGen/catch-nullptr-and-nonzero-offset-blacklist.c
  clang/test/CodeGen/ubsan-blacklist.c
  clang/test/CodeGenCXX/cfi-blacklist.cpp
  clang/test/Driver/debug-var-experimental-switch.c
  clang/test/Sema/branch-protection-attr-err.c
  compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt
  compiler-rt/lib/sanitizer_common/sanitizer_persistent_allocator.h
  compiler-rt/lib/tsan/rtl/tsan_update_shadow_word.inc
  compiler-rt/test/fuzzer/EntropicScalePerExecTimeTest.cpp
  compiler-rt/test/fuzzer/entropic-scale-per-exec-time.test
  compiler-rt/test/memprof/TestCases/mem_info_cache_entries.cpp
  compiler-rt/test/memprof/TestCases/print_miss_rate.cpp
  compiler-rt/test/ubsan/TestCases/Pointer/alignment-assumption-ignorelist.cppp
  libcxx/cmake/caches/Generic-32bits.cmake
  libcxx/include/__memory/pointer_safety.h
  libcxx/test/libcxx/atomics/ext-int.verify.cpp
  libcxx/test/libcxx/atomics/libcpp-has-no-threads.compile.fail.cpp
  libcxx/test/libcxx/atomics/libcpp-has-no-threads.pass.cpp
  libcxx/test/std/algorithms/robust_against_adl.pass.cpp
  
libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.compile.fail.cpp
  
libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp
  
libcxx/test/std/language.support/support.limits/support.limits.general/charconv.pass.cpp
  
libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.pass.cpp
  libcxx/test/std/numerics/c.math/abs.fail.cpp
  libcxx/test/std/strings/string.view/string.view.cons/deduct.pass.cpp
  
libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.fail.cpp
  
libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp
  
libcxx/test/std/utilities/memory/util.dynamic.safety/declare_no_pointers.pass.cpp
  
libcxx/test/std/utilities/memory/util.dynamic.safety/declare_reachable.pass.cpp
  
libcxx/test/std/utilities/memory/util.dynamic.safety/get_pointer_safety.pass.cpp
  
libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.deprecated.fail.cpp
  libcxx/test/support/coroutine_types.h
  libcxx/test/support/tracked_value.h
  libcxx/utils/google-benchmark/.clang-format
  libcxx/utils/google-benchmark/.github/.libcxx-setup.sh
  libcxx/utils/google-benchmark/.github/ISSUE_TEMPLATE/bug_report.md
  libcxx/utils/google-benchmark/.github/ISSUE_TEMPLATE/feature_request.md
  libcxx/utils/google-benchmark/.github/workflows/bazel.yml
  
libcxx/utils/google-benchmark/.github/workflows/build-and-test-perfcounters.yml
  libcxx/utils/google-benchmark/.github/workflows/build-and-test.yml
  libcxx/utils/google-benchmark/.github/workflows/pylint.yml
  libcxx/utils/google-benchmark/.github/workflows/sanitizer.yml
  libcxx/utils/google-benchmark/.github/workflows/test_bindings.yml
  libcxx/utils/google-benchmark/.gitignore
  libcxx/utils/google-benchmark/.travis.yml
  libcxx/utils/google-benchmark/.ycm_extra_conf.py
  libcxx/utils/google-benchmark/AUTHORS
  libcxx/utils/google-benchmark/BUILD.bazel
  libcxx/utils/google-benchmark/CMakeLists.txt
  libcxx/utils/google-benchmark/CONTRIBUTING.md
  libcxx/utils/google-benchmark/CONTRIBUTORS
  libcxx/utils/google-benchmark/LICENSE
  libcxx/utils/google-benchmark/README.md
  libcxx/utils/google-benchmark/WORKSPACE
  libcxx/utils/google-benchmark/_config.yml
  libcxx/utils/google-benchmark/appveyor.yml
  libcxx/utils/google-benchmark/bindings/python/BUILD
  libcxx/utils/google-benchmark/bindings/python/build_defs.bzl
  libcxx/utils/google-benchmark/bindings/python/google_benchmark/BUILD
  libcxx/utils/google-benchmark/bindings/python/google_benchmark/__init__.py
  

[PATCH] D116547: Revert "[amdgpu] Enable selection of `s_cselect_b64`."

2022-01-04 Thread David Salinas via Phabricator via cfe-commits
david-salinas abandoned this revision.
david-salinas added a comment.

Abandoning.  Will use D115960 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116547/new/

https://reviews.llvm.org/D116547

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D116547: Revert "[amdgpu] Enable selection of `s_cselect_b64`."

2022-01-03 Thread David Salinas via Phabricator via cfe-commits
david-salinas created this revision.
Herald added subscribers: luke957, abrachet, ormris, foad, dang, jdoerfert, 
phosek, kerbowa, usaxena95, pengfei, s.egerton, asbirlea, mstorsjo, lebedev.ri, 
kadircet, rupprecht, arphaman, steven_wu, mgrang, simoncook, fedor.sergeev, 
hiraditya, krytarowski, arichardson, t-tye, tpr, dstuttard, yaxunl, mgorny, 
nhaehnle, jvesely, kzhuravl, emaste, arsenm, dschuff.
Herald added a reviewer: lebedev.ri.
Herald added a reviewer: jhenderson.
Herald added a project: lld-macho.
Herald added a reviewer: lld-macho.
david-salinas requested review of this revision.
Herald added subscribers: cfe-commits, llvm-commits, libcxx-commits, 
lldb-commits, Sanitizers, sstefan1, MaskRay, wdng.
Herald added a reviewer: jdoerfert.
Herald added projects: clang, Sanitizers, LLDB, libc++, LLVM, clang-tools-extra.
Herald added a reviewer: libc++.

This reverts commit 640beb38e7710b939b3cfb3f4c54accc694b1d30 
.

Change-Id: I179ce9595d31af5847fc5c29d66ae8c845dff0a8


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116547

Files:
  clang-tools-extra/clangd/unittests/TestScheme.h
  clang/lib/Driver/ToolChains/HIP.cpp
  clang/lib/Driver/ToolChains/HIP.h
  clang/test/CodeGen/Inputs/sanitizer-blacklist-vfsoverlay.yaml
  clang/test/CodeGen/catch-alignment-assumption-blacklist.c
  clang/test/CodeGen/catch-nullptr-and-nonzero-offset-blacklist.c
  clang/test/CodeGen/ubsan-blacklist.c
  clang/test/CodeGenCXX/cfi-blacklist.cpp
  clang/test/Driver/debug-var-experimental-switch.c
  clang/test/Sema/branch-protection-attr-err.c
  compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt
  compiler-rt/lib/sanitizer_common/sanitizer_persistent_allocator.h
  compiler-rt/lib/tsan/rtl/tsan_update_shadow_word.inc
  compiler-rt/test/fuzzer/EntropicScalePerExecTimeTest.cpp
  compiler-rt/test/fuzzer/entropic-scale-per-exec-time.test
  compiler-rt/test/memprof/TestCases/mem_info_cache_entries.cpp
  compiler-rt/test/memprof/TestCases/print_miss_rate.cpp
  compiler-rt/test/ubsan/TestCases/Pointer/alignment-assumption-ignorelist.cppp
  libcxx/cmake/caches/Generic-32bits.cmake
  libcxx/include/__memory/pointer_safety.h
  libcxx/test/libcxx/atomics/ext-int.verify.cpp
  libcxx/test/libcxx/atomics/libcpp-has-no-threads.compile.fail.cpp
  libcxx/test/libcxx/atomics/libcpp-has-no-threads.pass.cpp
  libcxx/test/std/algorithms/robust_against_adl.pass.cpp
  
libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.compile.fail.cpp
  
libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp
  
libcxx/test/std/language.support/support.limits/support.limits.general/charconv.pass.cpp
  
libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.pass.cpp
  libcxx/test/std/numerics/c.math/abs.fail.cpp
  libcxx/test/std/strings/string.view/string.view.cons/deduct.pass.cpp
  
libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.fail.cpp
  
libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp
  
libcxx/test/std/utilities/memory/util.dynamic.safety/declare_no_pointers.pass.cpp
  
libcxx/test/std/utilities/memory/util.dynamic.safety/declare_reachable.pass.cpp
  
libcxx/test/std/utilities/memory/util.dynamic.safety/get_pointer_safety.pass.cpp
  
libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.deprecated.fail.cpp
  libcxx/test/support/coroutine_types.h
  libcxx/test/support/tracked_value.h
  libcxx/utils/google-benchmark/.clang-format
  libcxx/utils/google-benchmark/.github/.libcxx-setup.sh
  libcxx/utils/google-benchmark/.github/ISSUE_TEMPLATE/bug_report.md
  libcxx/utils/google-benchmark/.github/ISSUE_TEMPLATE/feature_request.md
  libcxx/utils/google-benchmark/.github/workflows/bazel.yml
  
libcxx/utils/google-benchmark/.github/workflows/build-and-test-perfcounters.yml
  libcxx/utils/google-benchmark/.github/workflows/build-and-test.yml
  libcxx/utils/google-benchmark/.github/workflows/pylint.yml
  libcxx/utils/google-benchmark/.github/workflows/sanitizer.yml
  libcxx/utils/google-benchmark/.github/workflows/test_bindings.yml
  libcxx/utils/google-benchmark/.gitignore
  libcxx/utils/google-benchmark/.travis.yml
  libcxx/utils/google-benchmark/.ycm_extra_conf.py
  libcxx/utils/google-benchmark/AUTHORS
  libcxx/utils/google-benchmark/BUILD.bazel
  libcxx/utils/google-benchmark/CMakeLists.txt
  libcxx/utils/google-benchmark/CONTRIBUTING.md
  libcxx/utils/google-benchmark/CONTRIBUTORS
  libcxx/utils/google-benchmark/LICENSE
  libcxx/utils/google-benchmark/README.md
  libcxx/utils/google-benchmark/WORKSPACE
  libcxx/utils/google-benchmark/_config.yml
  libcxx/utils/google-benchmark/appveyor.yml
  libcxx/utils/google-benchmark/bindings/python/BUILD
  libcxx/utils/google-benchmark/bindings/python/build_defs.bzl
  libcxx/utils/google-benchmark/bindings/python/google_benchmark/BUILD
  

[PATCH] D116224: Revert "[amdgpu] Enable selection of `s_cselect_b64`."

2021-12-23 Thread David Salinas via Phabricator via cfe-commits
david-salinas created this revision.
Herald added subscribers: luke957, abrachet, ormris, foad, dang, jdoerfert, 
phosek, kerbowa, usaxena95, pengfei, s.egerton, asbirlea, mstorsjo, lebedev.ri, 
kadircet, rupprecht, arphaman, steven_wu, mgrang, simoncook, fedor.sergeev, 
hiraditya, krytarowski, arichardson, t-tye, tpr, dstuttard, yaxunl, mgorny, 
nhaehnle, jvesely, kzhuravl, emaste, arsenm, dschuff.
Herald added a reviewer: lebedev.ri.
Herald added a reviewer: jhenderson.
Herald added a project: lld-macho.
Herald added a reviewer: lld-macho.
david-salinas requested review of this revision.
Herald added subscribers: cfe-commits, llvm-commits, libcxx-commits, 
lldb-commits, Sanitizers, sstefan1, MaskRay, wdng.
Herald added a reviewer: jdoerfert.
Herald added projects: clang, Sanitizers, LLDB, libc++, LLVM, clang-tools-extra.
Herald added a reviewer: libc++.

This reverts commit 640beb38e7710b939b3cfb3f4c54accc694b1d30 
.

Change-Id: I179ce9595d31af5847fc5c29d66ae8c845dff0a8


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116224

Files:
  clang-tools-extra/clangd/unittests/TestScheme.h
  clang/lib/Driver/ToolChains/HIP.cpp
  clang/lib/Driver/ToolChains/HIP.h
  clang/test/CodeGen/Inputs/sanitizer-blacklist-vfsoverlay.yaml
  clang/test/CodeGen/catch-alignment-assumption-blacklist.c
  clang/test/CodeGen/catch-nullptr-and-nonzero-offset-blacklist.c
  clang/test/CodeGen/ubsan-blacklist.c
  clang/test/CodeGenCXX/cfi-blacklist.cpp
  clang/test/Driver/debug-var-experimental-switch.c
  clang/test/Sema/branch-protection-attr-err.c
  clang/test/SemaCXX/PR51712-large-array-constexpr-check-oom.cpp
  compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt
  compiler-rt/lib/sanitizer_common/sanitizer_persistent_allocator.h
  compiler-rt/lib/tsan/rtl/tsan_update_shadow_word.inc
  compiler-rt/test/fuzzer/EntropicScalePerExecTimeTest.cpp
  compiler-rt/test/fuzzer/entropic-scale-per-exec-time.test
  compiler-rt/test/memprof/TestCases/mem_info_cache_entries.cpp
  compiler-rt/test/memprof/TestCases/print_miss_rate.cpp
  compiler-rt/test/ubsan/TestCases/Pointer/alignment-assumption-ignorelist.cppp
  libcxx/cmake/caches/Generic-32bits.cmake
  libcxx/include/__memory/pointer_safety.h
  libcxx/test/libcxx/atomics/ext-int.verify.cpp
  libcxx/test/libcxx/atomics/libcpp-has-no-threads.compile.fail.cpp
  libcxx/test/libcxx/atomics/libcpp-has-no-threads.pass.cpp
  libcxx/test/std/algorithms/robust_against_adl.pass.cpp
  
libcxx/test/std/atomics/atomics.types.generic/trivially_copyable.compile.fail.cpp
  
libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_value.pass.cpp
  
libcxx/test/std/language.support/support.limits/support.limits.general/charconv.pass.cpp
  
libcxx/test/std/language.support/support.limits/support.limits.general/memory_resource.version.pass.cpp
  libcxx/test/std/numerics/c.math/abs.fail.cpp
  libcxx/test/std/strings/string.view/string.view.cons/deduct.pass.cpp
  
libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.fail.cpp
  
libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp
  
libcxx/test/std/utilities/memory/util.dynamic.safety/declare_no_pointers.pass.cpp
  
libcxx/test/std/utilities/memory/util.dynamic.safety/declare_reachable.pass.cpp
  
libcxx/test/std/utilities/memory/util.dynamic.safety/get_pointer_safety.pass.cpp
  
libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.deprecated.fail.cpp
  libcxx/test/support/coroutine_types.h
  libcxx/test/support/tracked_value.h
  libcxx/utils/google-benchmark/.clang-format
  libcxx/utils/google-benchmark/.github/.libcxx-setup.sh
  libcxx/utils/google-benchmark/.github/ISSUE_TEMPLATE/bug_report.md
  libcxx/utils/google-benchmark/.github/ISSUE_TEMPLATE/feature_request.md
  libcxx/utils/google-benchmark/.github/workflows/bazel.yml
  
libcxx/utils/google-benchmark/.github/workflows/build-and-test-perfcounters.yml
  libcxx/utils/google-benchmark/.github/workflows/build-and-test.yml
  libcxx/utils/google-benchmark/.github/workflows/pylint.yml
  libcxx/utils/google-benchmark/.github/workflows/sanitizer.yml
  libcxx/utils/google-benchmark/.github/workflows/test_bindings.yml
  libcxx/utils/google-benchmark/.gitignore
  libcxx/utils/google-benchmark/.travis.yml
  libcxx/utils/google-benchmark/.ycm_extra_conf.py
  libcxx/utils/google-benchmark/AUTHORS
  libcxx/utils/google-benchmark/BUILD.bazel
  libcxx/utils/google-benchmark/CMakeLists.txt
  libcxx/utils/google-benchmark/CONTRIBUTING.md
  libcxx/utils/google-benchmark/CONTRIBUTORS
  libcxx/utils/google-benchmark/LICENSE
  libcxx/utils/google-benchmark/README.md
  libcxx/utils/google-benchmark/WORKSPACE
  libcxx/utils/google-benchmark/_config.yml
  libcxx/utils/google-benchmark/appveyor.yml
  libcxx/utils/google-benchmark/bindings/python/BUILD
  libcxx/utils/google-benchmark/bindings/python/build_defs.bzl
  

[PATCH] D58346: [Sema] Change addr space diagnostics in casts to follow C++ style

2019-03-08 Thread David Salinas via Phabricator via cfe-commits
david-salinas added a comment.

This change has caused a regression for generic C++.  Should this affect OpenCL 
only?

The following simple test causes the diagnostic to be emitted:

#define ATTR_GLOBAL __attribute__((address_space(1)))

int calc(int ATTR_GLOBAL *ip) {

  int i = *ip;
  return i+1;

}

int main() {

  int i = 99;
  int *ip = 
  
  auto *g_i_ptr = reinterpret_cast(ip);
  return calc(g_i_ptr);

}


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58346/new/

https://reviews.llvm.org/D58346



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D53780: Fix bitcast to address space cast for coerced load/stores

2018-11-05 Thread David Salinas via Phabricator via cfe-commits
david-salinas updated this revision to Diff 172673.
david-salinas added a comment.

fix missing ;


Repository:
  rC Clang

https://reviews.llvm.org/D53780

Files:
  lib/CodeGen/CGCall.cpp
  test/CodeGenCXX/address-space-cast-coerce.cpp


Index: test/CodeGenCXX/address-space-cast-coerce.cpp
===
--- /dev/null
+++ test/CodeGenCXX/address-space-cast-coerce.cpp
@@ -0,0 +1,53 @@
+// RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck %s
+
+template struct my_vector_base;
+
+template
+struct my_vector_base {
+typedef T Native_vec_ __attribute__((ext_vector_type(1)));
+
+union {
+Native_vec_ data;
+struct {
+T x;
+};
+};
+};
+
+template
+struct my_vector_type : public my_vector_base {
+using my_vector_base::data;
+using typename my_vector_base::Native_vec_;
+
+template< typename U>
+my_vector_type(U x) noexcept
+{
+for (auto i = 0u; i != rank; ++i) data[i] = x;
+}
+my_vector_type& operator+=(const my_vector_type& x) noexcept
+{
+data += x.data;
+return *this;
+}
+};
+
+template
+inline
+my_vector_type operator+(
+const my_vector_type& x, const my_vector_type& y) noexcept
+{
+return my_vector_type{x} += y;
+}
+
+using char1 = my_vector_type;
+
+int mane() {
+
+char1 f1{1};
+char1 f2{1};
+
+// CHECK: %[[a:[^ ]+]] = addrspacecast i16 addrspace(5)* %{{[^ ]+}} to i16*
+// CHECK: %[[a:[^ ]+]] = addrspacecast %{{[^ ]+}} addrspace(5)* %{{[^ ]+}} to 
%{{[^ ]+}} 
+
+char1 f3 = f1 + f2;
+}
Index: lib/CodeGen/CGCall.cpp
===
--- lib/CodeGen/CGCall.cpp
+++ lib/CodeGen/CGCall.cpp
@@ -1253,8 +1253,8 @@
 
   // Otherwise do coercion through memory. This is stupid, but simple.
   Address Tmp = CreateTempAllocaForCoercion(CGF, Ty, Src.getAlignment());
-  Address Casted = CGF.Builder.CreateBitCast(Tmp, CGF.AllocaInt8PtrTy);
-  Address SrcCasted = CGF.Builder.CreateBitCast(Src, CGF.AllocaInt8PtrTy);
+  Address Casted = CGF.Builder.CreateElementBitCast(Tmp,CGF.Int8Ty);
+  Address SrcCasted = CGF.Builder.CreateElementBitCast(Src,CGF.Int8Ty);
   CGF.Builder.CreateMemCpy(Casted, SrcCasted,
   llvm::ConstantInt::get(CGF.IntPtrTy, SrcSize),
   false);
@@ -1335,8 +1335,8 @@
 // to that information.
 Address Tmp = CreateTempAllocaForCoercion(CGF, SrcTy, Dst.getAlignment());
 CGF.Builder.CreateStore(Src, Tmp);
-Address Casted = CGF.Builder.CreateBitCast(Tmp, CGF.AllocaInt8PtrTy);
-Address DstCasted = CGF.Builder.CreateBitCast(Dst, CGF.AllocaInt8PtrTy);
+Address Casted = CGF.Builder.CreateElementBitCast(Tmp,CGF.Int8Ty);
+Address DstCasted = CGF.Builder.CreateElementBitCast(Dst,CGF.Int8Ty);
 CGF.Builder.CreateMemCpy(DstCasted, Casted,
 llvm::ConstantInt::get(CGF.IntPtrTy, DstSize),
 false);


Index: test/CodeGenCXX/address-space-cast-coerce.cpp
===
--- /dev/null
+++ test/CodeGenCXX/address-space-cast-coerce.cpp
@@ -0,0 +1,53 @@
+// RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck %s
+
+template struct my_vector_base;
+
+template
+struct my_vector_base {
+typedef T Native_vec_ __attribute__((ext_vector_type(1)));
+
+union {
+Native_vec_ data;
+struct {
+T x;
+};
+};
+};
+
+template
+struct my_vector_type : public my_vector_base {
+using my_vector_base::data;
+using typename my_vector_base::Native_vec_;
+
+template< typename U>
+my_vector_type(U x) noexcept
+{
+for (auto i = 0u; i != rank; ++i) data[i] = x;
+}
+my_vector_type& operator+=(const my_vector_type& x) noexcept
+{
+data += x.data;
+return *this;
+}
+};
+
+template
+inline
+my_vector_type operator+(
+const my_vector_type& x, const my_vector_type& y) noexcept
+{
+return my_vector_type{x} += y;
+}
+
+using char1 = my_vector_type;
+
+int mane() {
+
+char1 f1{1};
+char1 f2{1};
+
+// CHECK: %[[a:[^ ]+]] = addrspacecast i16 addrspace(5)* %{{[^ ]+}} to i16*
+// CHECK: %[[a:[^ ]+]] = addrspacecast %{{[^ ]+}} addrspace(5)* %{{[^ ]+}} to %{{[^ ]+}} 
+
+char1 f3 = f1 + f2;
+}
Index: lib/CodeGen/CGCall.cpp
===
--- lib/CodeGen/CGCall.cpp
+++ lib/CodeGen/CGCall.cpp
@@ -1253,8 +1253,8 @@
 
   // Otherwise do coercion through memory. This is stupid, but simple.
   Address Tmp = CreateTempAllocaForCoercion(CGF, Ty, Src.getAlignment());
-  Address Casted = CGF.Builder.CreateBitCast(Tmp, CGF.AllocaInt8PtrTy);
-  Address SrcCasted = 

[PATCH] D53780: Fix bitcast to address space cast for coerced load/stores

2018-11-05 Thread David Salinas via Phabricator via cfe-commits
david-salinas updated this revision to Diff 172671.
david-salinas added a comment.

using CreateElementBitCast instead


Repository:
  rC Clang

https://reviews.llvm.org/D53780

Files:
  lib/CodeGen/CGCall.cpp
  test/CodeGenCXX/address-space-cast-coerce.cpp


Index: test/CodeGenCXX/address-space-cast-coerce.cpp
===
--- /dev/null
+++ test/CodeGenCXX/address-space-cast-coerce.cpp
@@ -0,0 +1,53 @@
+// RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck %s
+
+template struct my_vector_base;
+
+template
+struct my_vector_base {
+typedef T Native_vec_ __attribute__((ext_vector_type(1)));
+
+union {
+Native_vec_ data;
+struct {
+T x;
+};
+};
+};
+
+template
+struct my_vector_type : public my_vector_base {
+using my_vector_base::data;
+using typename my_vector_base::Native_vec_;
+
+template< typename U>
+my_vector_type(U x) noexcept
+{
+for (auto i = 0u; i != rank; ++i) data[i] = x;
+}
+my_vector_type& operator+=(const my_vector_type& x) noexcept
+{
+data += x.data;
+return *this;
+}
+};
+
+template
+inline
+my_vector_type operator+(
+const my_vector_type& x, const my_vector_type& y) noexcept
+{
+return my_vector_type{x} += y;
+}
+
+using char1 = my_vector_type;
+
+int mane() {
+
+char1 f1{1};
+char1 f2{1};
+
+// CHECK: %[[a:[^ ]+]] = addrspacecast i16 addrspace(5)* %{{[^ ]+}} to i16*
+// CHECK: %[[a:[^ ]+]] = addrspacecast %{{[^ ]+}} addrspace(5)* %{{[^ ]+}} to 
%{{[^ ]+}} 
+
+char1 f3 = f1 + f2;
+}
Index: lib/CodeGen/CGCall.cpp
===
--- lib/CodeGen/CGCall.cpp
+++ lib/CodeGen/CGCall.cpp
@@ -1253,8 +1253,10 @@
 
   // Otherwise do coercion through memory. This is stupid, but simple.
   Address Tmp = CreateTempAllocaForCoercion(CGF, Ty, Src.getAlignment());
-  Address Casted = CGF.Builder.CreateBitCast(Tmp, CGF.AllocaInt8PtrTy);
-  Address SrcCasted = CGF.Builder.CreateBitCast(Src, CGF.AllocaInt8PtrTy);
+  // Address Casted = CGF.Builder.CreateBitCast(Tmp, 
CGF.Int8Ty->getPointerTo(Tmp.getAddressSpace()));
+  Address Casted = CGF.Builder.CreateElementBitCast(Tmp,CGF.Int8Ty)
+  // Address SrcCasted = CGF.Builder.CreateBitCast(Src, 
CGF.Int8Ty->getPointerTo(Src.getAddressSpace()));
+  Address SrcCasted = CGF.Builder.CreateElementBitCast(Src,CGF.Int8Ty)
   CGF.Builder.CreateMemCpy(Casted, SrcCasted,
   llvm::ConstantInt::get(CGF.IntPtrTy, SrcSize),
   false);
@@ -1335,8 +1337,10 @@
 // to that information.
 Address Tmp = CreateTempAllocaForCoercion(CGF, SrcTy, Dst.getAlignment());
 CGF.Builder.CreateStore(Src, Tmp);
-Address Casted = CGF.Builder.CreateBitCast(Tmp, CGF.AllocaInt8PtrTy);
-Address DstCasted = CGF.Builder.CreateBitCast(Dst, CGF.AllocaInt8PtrTy);
+// Address Casted = CGF.Builder.CreateBitCast(Tmp, 
CGF.Int8Ty->getPointerTo(Tmp.getAddressSpace()));
+Address Casted = CGF.Builder.CreateElementBitCast(Tmp,CGF.Int8Ty)
+// Address DstCasted = CGF.Builder.CreateBitCast(Dst, 
CGF.Int8Ty->getPointerTo(Dst.getAddressSpace()));
+Address DstCasted = CGF.Builder.CreateElementBitCast(Dst,CGF.Int8Ty)
 CGF.Builder.CreateMemCpy(DstCasted, Casted,
 llvm::ConstantInt::get(CGF.IntPtrTy, DstSize),
 false);


Index: test/CodeGenCXX/address-space-cast-coerce.cpp
===
--- /dev/null
+++ test/CodeGenCXX/address-space-cast-coerce.cpp
@@ -0,0 +1,53 @@
+// RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck %s
+
+template struct my_vector_base;
+
+template
+struct my_vector_base {
+typedef T Native_vec_ __attribute__((ext_vector_type(1)));
+
+union {
+Native_vec_ data;
+struct {
+T x;
+};
+};
+};
+
+template
+struct my_vector_type : public my_vector_base {
+using my_vector_base::data;
+using typename my_vector_base::Native_vec_;
+
+template< typename U>
+my_vector_type(U x) noexcept
+{
+for (auto i = 0u; i != rank; ++i) data[i] = x;
+}
+my_vector_type& operator+=(const my_vector_type& x) noexcept
+{
+data += x.data;
+return *this;
+}
+};
+
+template
+inline
+my_vector_type operator+(
+const my_vector_type& x, const my_vector_type& y) noexcept
+{
+return my_vector_type{x} += y;
+}
+
+using char1 = my_vector_type;
+
+int mane() {
+
+char1 f1{1};
+char1 f2{1};
+
+// CHECK: %[[a:[^ ]+]] = addrspacecast i16 addrspace(5)* %{{[^ ]+}} to i16*
+// CHECK: %[[a:[^ ]+]] = addrspacecast %{{[^ ]+}} addrspace(5)* %{{[^ ]+}} to %{{[^ ]+}} 
+
+char1 f3 = f1 + f2;
+}

[PATCH] D53780: Fix bitcast to address space cast for coerced load/stores

2018-11-02 Thread David Salinas via Phabricator via cfe-commits
david-salinas updated this revision to Diff 172261.
david-salinas added a comment.

As per rjmccall's comments, changed the call to 
CreatePointerBitCastOrAddrSpaceCast back to a call to CreateBitCast, but now 
we're casting to the int8* with the address space of the target.


https://reviews.llvm.org/D53780

Files:
  lib/CodeGen/CGCall.cpp
  test/CodeGenCXX/address-space-cast-coerce.cpp

Index: test/CodeGenCXX/address-space-cast-coerce.cpp
===
--- /dev/null
+++ test/CodeGenCXX/address-space-cast-coerce.cpp
@@ -0,0 +1,81 @@
+// RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck %s
+
+template struct my_vector_base;
+
+template
+struct my_vector_base {
+typedef T Native_vec_ __attribute__((ext_vector_type(1)));
+
+union {
+Native_vec_ data;
+struct {
+T x;
+};
+};
+};
+
+template
+struct my_vector_type : public my_vector_base {
+using my_vector_base::data;
+using typename my_vector_base::Native_vec_;
+
+template< typename U>
+__attribute__((cpu)) __attribute__((hc))
+my_vector_type(U x) noexcept
+{
+for (auto i = 0u; i != rank; ++i) data[i] = x;
+}
+__attribute__((cpu)) __attribute__((hc))
+my_vector_type& operator+=(const my_vector_type& x) noexcept
+{
+data += x.data;
+return *this;
+}
+};
+
+template
+__attribute__((cpu)) __attribute__((hc))
+inline
+my_vector_type operator+(
+const my_vector_type& x, const my_vector_type& y) noexcept
+{
+return my_vector_type{x} += y;
+}
+
+using char1 = my_vector_type;
+
+int main() {
+
+char1 f1{1};
+char1 f2{1};
+
+// CHECK: %[[a:[^ ]+]] = addrspacecast i16 addrspace(5)* %{{[^ ]+}} to i16*
+// CHECK: %[[a:[^ ]+]] = addrspacecast %{{[^ ]+}} addrspace(5)* %{{[^ ]+}} to %{{[^ ]+}} 
+
+char1 f3 = f1 + f2;
+}
+
+/*
+
+Look for this:
+HECK:  %4 = addrspacecast i16 addrspace(5)* %tmp to i16*
+HECK:  %5 = addrspacecast %struct.my_vector_type* addrspace(5)* %this.addr.i to %struct.my_vector_type**
+
+FAIL<
+pass>
+38,39c38,39
+<   %5 = bitcast i16* %4 to i8 addrspace(5)*
+<   %6 = bitcast <1 x i8>* %coerce.dive2 to i8 addrspace(5)*
+---
+>   %5 = addrspacecast i16* %4 to i8 addrspace(5)*
+>   %6 = addrspacecast <1 x i8>* %coerce.dive2 to i8 addrspace(5)*
+86,87c86,87
+<   %11 = bitcast i16* %4 to i8 addrspace(5)*
+<   %12 = bitcast <1 x i8>* %coerce.dive2 to i8 addrspace(5)*
+---
+>   %11 = addrspacecast i16* %4 to i8 addrspace(5)*
+>   %12 = addrspacecast <1 x i8>* %coerce.dive2 to i8 addrspace(5)*
+
+
+*/
+
Index: lib/CodeGen/CGCall.cpp
===
--- lib/CodeGen/CGCall.cpp
+++ lib/CodeGen/CGCall.cpp
@@ -1253,8 +1253,8 @@
 
   // Otherwise do coercion through memory. This is stupid, but simple.
   Address Tmp = CreateTempAllocaForCoercion(CGF, Ty, Src.getAlignment());
-  Address Casted = CGF.Builder.CreateBitCast(Tmp, CGF.AllocaInt8PtrTy);
-  Address SrcCasted = CGF.Builder.CreateBitCast(Src, CGF.AllocaInt8PtrTy);
+  Address Casted = CGF.Builder.CreateBitCast(Tmp, CGF.Int8Ty->getPointerTo(Tmp.getAddressSpace()));
+  Address SrcCasted = CGF.Builder.CreateBitCast(Src, CGF.Int8Ty->getPointerTo(Src.getAddressSpace()));
   CGF.Builder.CreateMemCpy(Casted, SrcCasted,
   llvm::ConstantInt::get(CGF.IntPtrTy, SrcSize),
   false);
@@ -1335,8 +1335,8 @@
 // to that information.
 Address Tmp = CreateTempAllocaForCoercion(CGF, SrcTy, Dst.getAlignment());
 CGF.Builder.CreateStore(Src, Tmp);
-Address Casted = CGF.Builder.CreateBitCast(Tmp, CGF.AllocaInt8PtrTy);
-Address DstCasted = CGF.Builder.CreateBitCast(Dst, CGF.AllocaInt8PtrTy);
+Address Casted = CGF.Builder.CreateBitCast(Tmp,CGF.Int8Ty->getPointerTo(Tmp.getAddressSpace()) );
+Address DstCasted = CGF.Builder.CreateBitCast(Dst, CGF.Int8Ty->getPointerTo(Dst.getAddressSpace()));
 CGF.Builder.CreateMemCpy(DstCasted, Casted,
 llvm::ConstantInt::get(CGF.IntPtrTy, DstSize),
 false);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D53780: Fix bitcast to address space cast for coerced load/stores

2018-10-26 Thread David Salinas via Phabricator via cfe-commits
david-salinas updated this revision to Diff 171367.
david-salinas added a comment.

remove __attribute__((cpu)) __attribute__((hc)) from test


Repository:
  rC Clang

https://reviews.llvm.org/D53780

Files:
  lib/CodeGen/CGCall.cpp
  test/CodeGenCXX/address-space-cast-coerce.cpp


Index: test/CodeGenCXX/address-space-cast-coerce.cpp
===
--- /dev/null
+++ test/CodeGenCXX/address-space-cast-coerce.cpp
@@ -0,0 +1,53 @@
+// RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck %s
+
+template struct my_vector_base;
+
+template
+struct my_vector_base {
+typedef T Native_vec_ __attribute__((ext_vector_type(1)));
+
+union {
+Native_vec_ data;
+struct {
+T x;
+};
+};
+};
+
+template
+struct my_vector_type : public my_vector_base {
+using my_vector_base::data;
+using typename my_vector_base::Native_vec_;
+
+template< typename U>
+my_vector_type(U x) noexcept
+{
+for (auto i = 0u; i != rank; ++i) data[i] = x;
+}
+my_vector_type& operator+=(const my_vector_type& x) noexcept
+{
+data += x.data;
+return *this;
+}
+};
+
+template
+inline
+my_vector_type operator+(
+const my_vector_type& x, const my_vector_type& y) noexcept
+{
+return my_vector_type{x} += y;
+}
+
+using char1 = my_vector_type;
+
+int mane() {
+
+char1 f1{1};
+char1 f2{1};
+
+// CHECK: %[[a:[^ ]+]] = addrspacecast i16 addrspace(5)* %{{[^ ]+}} to i16*
+// CHECK: %[[a:[^ ]+]] = addrspacecast %{{[^ ]+}} addrspace(5)* %{{[^ ]+}} to 
%{{[^ ]+}} 
+
+char1 f3 = f1 + f2;
+}
Index: lib/CodeGen/CGCall.cpp
===
--- lib/CodeGen/CGCall.cpp
+++ lib/CodeGen/CGCall.cpp
@@ -1253,8 +1253,8 @@
 
   // Otherwise do coercion through memory. This is stupid, but simple.
   Address Tmp = CreateTempAllocaForCoercion(CGF, Ty, Src.getAlignment());
-  Address Casted = CGF.Builder.CreateBitCast(Tmp, CGF.AllocaInt8PtrTy);
-  Address SrcCasted = CGF.Builder.CreateBitCast(Src, CGF.AllocaInt8PtrTy);
+  Address Casted = CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(Tmp, 
CGF.AllocaInt8PtrTy);
+  Address SrcCasted = CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(Src, 
CGF.AllocaInt8PtrTy);
   CGF.Builder.CreateMemCpy(Casted, SrcCasted,
   llvm::ConstantInt::get(CGF.IntPtrTy, SrcSize),
   false);
@@ -1335,8 +1335,8 @@
 // to that information.
 Address Tmp = CreateTempAllocaForCoercion(CGF, SrcTy, Dst.getAlignment());
 CGF.Builder.CreateStore(Src, Tmp);
-Address Casted = CGF.Builder.CreateBitCast(Tmp, CGF.AllocaInt8PtrTy);
-Address DstCasted = CGF.Builder.CreateBitCast(Dst, CGF.AllocaInt8PtrTy);
+Address Casted = CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(Tmp, 
CGF.AllocaInt8PtrTy);
+Address DstCasted = CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(Dst, 
CGF.AllocaInt8PtrTy);
 CGF.Builder.CreateMemCpy(DstCasted, Casted,
 llvm::ConstantInt::get(CGF.IntPtrTy, DstSize),
 false);


Index: test/CodeGenCXX/address-space-cast-coerce.cpp
===
--- /dev/null
+++ test/CodeGenCXX/address-space-cast-coerce.cpp
@@ -0,0 +1,53 @@
+// RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck %s
+
+template struct my_vector_base;
+
+template
+struct my_vector_base {
+typedef T Native_vec_ __attribute__((ext_vector_type(1)));
+
+union {
+Native_vec_ data;
+struct {
+T x;
+};
+};
+};
+
+template
+struct my_vector_type : public my_vector_base {
+using my_vector_base::data;
+using typename my_vector_base::Native_vec_;
+
+template< typename U>
+my_vector_type(U x) noexcept
+{
+for (auto i = 0u; i != rank; ++i) data[i] = x;
+}
+my_vector_type& operator+=(const my_vector_type& x) noexcept
+{
+data += x.data;
+return *this;
+}
+};
+
+template
+inline
+my_vector_type operator+(
+const my_vector_type& x, const my_vector_type& y) noexcept
+{
+return my_vector_type{x} += y;
+}
+
+using char1 = my_vector_type;
+
+int mane() {
+
+char1 f1{1};
+char1 f2{1};
+
+// CHECK: %[[a:[^ ]+]] = addrspacecast i16 addrspace(5)* %{{[^ ]+}} to i16*
+// CHECK: %[[a:[^ ]+]] = addrspacecast %{{[^ ]+}} addrspace(5)* %{{[^ ]+}} to %{{[^ ]+}} 
+
+char1 f3 = f1 + f2;
+}
Index: lib/CodeGen/CGCall.cpp
===
--- lib/CodeGen/CGCall.cpp
+++ lib/CodeGen/CGCall.cpp
@@ -1253,8 +1253,8 @@
 
   // Otherwise do coercion through memory. This is stupid, but simple.
   Address Tmp = CreateTempAllocaForCoercion(CGF, 

[PATCH] D53780: Fix bitcast to address space cast for coerced load/stores

2018-10-26 Thread David Salinas via Phabricator via cfe-commits
david-salinas created this revision.
david-salinas added reviewers: yaxunl, scchan.
Herald added a subscriber: cfe-commits.

Coerced load/stores through memory do not take into account potential address 
space differences  when it creates its bitcasts.


Repository:
  rC Clang

https://reviews.llvm.org/D53780

Files:
  lib/CodeGen/CGCall.cpp
  test/CodeGenCXX/address-space-cast-coerce.cpp


Index: test/CodeGenCXX/address-space-cast-coerce.cpp
===
--- /dev/null
+++ test/CodeGenCXX/address-space-cast-coerce.cpp
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck %s
+
+template struct my_vector_base;
+
+template
+struct my_vector_base {
+typedef T Native_vec_ __attribute__((ext_vector_type(1)));
+
+union {
+Native_vec_ data;
+struct {
+T x;
+};
+};
+};
+
+template
+struct my_vector_type : public my_vector_base {
+using my_vector_base::data;
+using typename my_vector_base::Native_vec_;
+
+template< typename U>
+__attribute__((cpu)) __attribute__((hc))
+my_vector_type(U x) noexcept
+{
+for (auto i = 0u; i != rank; ++i) data[i] = x;
+}
+__attribute__((cpu)) __attribute__((hc))
+my_vector_type& operator+=(const my_vector_type& x) noexcept
+{
+data += x.data;
+return *this;
+}
+};
+
+template
+__attribute__((cpu)) __attribute__((hc))
+inline
+my_vector_type operator+(
+const my_vector_type& x, const my_vector_type& y) noexcept
+{
+return my_vector_type{x} += y;
+}
+
+using char1 = my_vector_type;
+
+int main() {
+
+char1 f1{1};
+char1 f2{1};
+
+// CHECK: %[[a:[^ ]+]] = addrspacecast i16 addrspace(5)* %{{[^ ]+}} to i16*
+// CHECK: %[[a:[^ ]+]] = addrspacecast %{{[^ ]+}} addrspace(5)* %{{[^ ]+}} to 
%{{[^ ]+}} 
+
+char1 f3 = f1 + f2;
+}
Index: lib/CodeGen/CGCall.cpp
===
--- lib/CodeGen/CGCall.cpp
+++ lib/CodeGen/CGCall.cpp
@@ -1253,8 +1253,8 @@
 
   // Otherwise do coercion through memory. This is stupid, but simple.
   Address Tmp = CreateTempAllocaForCoercion(CGF, Ty, Src.getAlignment());
-  Address Casted = CGF.Builder.CreateBitCast(Tmp, CGF.AllocaInt8PtrTy);
-  Address SrcCasted = CGF.Builder.CreateBitCast(Src, CGF.AllocaInt8PtrTy);
+  Address Casted = CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(Tmp, 
CGF.AllocaInt8PtrTy);
+  Address SrcCasted = CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(Src, 
CGF.AllocaInt8PtrTy);
   CGF.Builder.CreateMemCpy(Casted, SrcCasted,
   llvm::ConstantInt::get(CGF.IntPtrTy, SrcSize),
   false);
@@ -1335,8 +1335,8 @@
 // to that information.
 Address Tmp = CreateTempAllocaForCoercion(CGF, SrcTy, Dst.getAlignment());
 CGF.Builder.CreateStore(Src, Tmp);
-Address Casted = CGF.Builder.CreateBitCast(Tmp, CGF.AllocaInt8PtrTy);
-Address DstCasted = CGF.Builder.CreateBitCast(Dst, CGF.AllocaInt8PtrTy);
+Address Casted = CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(Tmp, 
CGF.AllocaInt8PtrTy);
+Address DstCasted = CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(Dst, 
CGF.AllocaInt8PtrTy);
 CGF.Builder.CreateMemCpy(DstCasted, Casted,
 llvm::ConstantInt::get(CGF.IntPtrTy, DstSize),
 false);


Index: test/CodeGenCXX/address-space-cast-coerce.cpp
===
--- /dev/null
+++ test/CodeGenCXX/address-space-cast-coerce.cpp
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -emit-llvm -o - | FileCheck %s
+
+template struct my_vector_base;
+
+template
+struct my_vector_base {
+typedef T Native_vec_ __attribute__((ext_vector_type(1)));
+
+union {
+Native_vec_ data;
+struct {
+T x;
+};
+};
+};
+
+template
+struct my_vector_type : public my_vector_base {
+using my_vector_base::data;
+using typename my_vector_base::Native_vec_;
+
+template< typename U>
+__attribute__((cpu)) __attribute__((hc))
+my_vector_type(U x) noexcept
+{
+for (auto i = 0u; i != rank; ++i) data[i] = x;
+}
+__attribute__((cpu)) __attribute__((hc))
+my_vector_type& operator+=(const my_vector_type& x) noexcept
+{
+data += x.data;
+return *this;
+}
+};
+
+template
+__attribute__((cpu)) __attribute__((hc))
+inline
+my_vector_type operator+(
+const my_vector_type& x, const my_vector_type& y) noexcept
+{
+return my_vector_type{x} += y;
+}
+
+using char1 = my_vector_type;
+
+int main() {
+
+char1 f1{1};
+char1 f2{1};
+
+// CHECK: %[[a:[^ ]+]] = addrspacecast i16 addrspace(5)* %{{[^ ]+}} to i16*
+// CHECK: %[[a:[^