[OpenCL] Map default address space to alloca address space
authorYaxun Liu <Yaxun.Liu@amd.com>
Tue, 11 Apr 2017 17:24:23 +0000 (17:24 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Tue, 11 Apr 2017 17:24:23 +0000 (17:24 +0000)
commitb34ec829beb543358ffb1bf6e51a18e5ce9265d3
treeb2d9a65ffcda8041f7eaee464aa4485b1b045a84
parente95df719e1eeb62df169c757370c48c5910ca675
[OpenCL] Map default address space to alloca address space

For OpenCL, the private address space qualifier is 0 in AST. Before this change, 0 address space qualifier
is always mapped to target address space 0. As now target private address space is specified by
alloca address space in data layout, address space qualifier 0 needs to be mapped to alloca addr space specified by the data layout.

This change has no impact on targets whose alloca addr space is 0.

With contributions from Matt Arsenault, Tony Tye and Wen-Heng (Jack) Chung

Differential Revision: https://reviews.llvm.org/D31404

llvm-svn: 299965
17 files changed:
clang/include/clang/AST/ASTContext.h
clang/include/clang/AST/Type.h
clang/include/clang/Basic/AddressSpaces.h
clang/lib/AST/ASTContext.cpp
clang/lib/AST/ExprClassification.cpp
clang/lib/AST/TypePrinter.cpp
clang/lib/Basic/Targets.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/lib/Sema/SemaOverload.cpp
clang/lib/Sema/SemaType.cpp
clang/test/CodeGen/address-space.c
clang/test/CodeGen/default-address-space.c [new file with mode: 0644]
clang/test/CodeGenOpenCL/address-spaces.cl
clang/test/CodeGenOpenCL/amdgpu-env-amdgiz.cl
clang/test/CodeGenOpenCL/vla.cl
clang/test/Sema/address_spaces.c
clang/test/SemaOpenCL/invalid-assignment-constant-address-space.cl [moved from clang/test/Sema/invalid-assignment-constant-address-space.c with 59% similarity]