summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/support
diff options
context:
space:
mode:
authorAndrew Savonichev <andrew.savonichev@intel.com>2018-12-10 12:03:00 +0000
committerAndrew Savonichev <andrew.savonichev@intel.com>2018-12-10 12:03:00 +0000
commit1bf1a156d673d5d48ef2ca41cba642c5ed11d683 (patch)
tree2fff37735798eee282d6a2deef6246140cec73ae /lldb/packages/Python/lldbsuite/support
parent045c67769d7fe577fc38cccb6fb40fd814437447 (diff)
downloadbcm5719-llvm-1bf1a156d673d5d48ef2ca41cba642c5ed11d683.tar.gz
bcm5719-llvm-1bf1a156d673d5d48ef2ca41cba642c5ed11d683.zip
[OpenCL][CodeGen] Fix replacing memcpy with addrspacecast
Summary: If a function argument is byval and RV is located in default or alloca address space an optimization of creating addrspacecast instead of memcpy is performed. That is not correct for OpenCL, where that can lead to a situation of address space casting from __private * to __global *. See an example below: ``` typedef struct { int x; } MyStruct; void foo(MyStruct val) {} kernel void KernelOneMember(__global MyStruct* x) { foo (*x); } ``` for this code clang generated following IR: ... %0 = load %struct.MyStruct addrspace(1)*, %struct.MyStruct addrspace(1)** %x.addr, align 4 %1 = addrspacecast %struct.MyStruct addrspace(1)* %0 to %struct.MyStruct* ... So the optimization was disallowed for OpenCL if RV is located in an address space different than that of the argument (0). Reviewers: yaxunl, Anastasia Reviewed By: Anastasia Subscribers: cfe-commits, asavonic Differential Revision: https://reviews.llvm.org/D54947 llvm-svn: 348752
Diffstat (limited to 'lldb/packages/Python/lldbsuite/support')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud