]> granicus.if.org Git - clang/commit
CodeGen: Cast temporary variable to proper address space
authorYaxun Liu <Yaxun.Liu@amd.com>
Mon, 19 Jun 2017 17:03:41 +0000 (17:03 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Mon, 19 Jun 2017 17:03:41 +0000 (17:03 +0000)
commit1b12bf4092573db0add5649e9fbe9925a141c328
treed88081b5ad9b61490f769da0e084aa51563e9a89
parent0e83c02b0cedfbf32cc06a77394bc66dc71c2399
CodeGen: Cast temporary variable to proper address space

In C++ all variables are in default address space. Previously change has been
made to cast automatic variables to default address space. However that is
not sufficient since all temporary variables need to be casted to default
address space.

This patch casts all temporary variables to default address space except those
for passing indirect arguments since they are only used for load/store.

This patch only affects target having non-zero alloca address space.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305711 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGCall.cpp
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CodeGenFunction.h
test/CodeGen/address-space.c
test/CodeGen/default-address-space.c
test/CodeGen/x86_64-arguments.c
test/CodeGenCXX/amdgcn-automatic-variable.cpp