[AMDGPU] Temporarily change constant address space from 4 to 2 for the new address space mapping

Change constant address space from 4 to 2 for the new address space mapping in Clang.

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

llvm-svn: 299691
This commit is contained in:
Yaxun Liu 2017-04-06 19:18:36 +00:00
parent 76ae47cb35
commit b122ed9181
3 changed files with 7 additions and 5 deletions

View File

@ -2042,10 +2042,10 @@ static const LangAS::Map AMDGPUPrivateIsZeroMap = {
static const LangAS::Map AMDGPUGenericIsZeroMap = {
1, // opencl_global
3, // opencl_local
4, // opencl_constant
2, // opencl_constant
0, // opencl_generic
1, // cuda_device
4, // cuda_constant
2, // cuda_constant
3 // cuda_shared
};
@ -2062,7 +2062,7 @@ static const char *const DataLayoutStringSIPrivateIsZero =
"-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64";
static const char *const DataLayoutStringSIGenericIsZero =
"e-p:64:64-p1:64:64-p2:64:64-p3:32:32-p4:64:64-p5:32:32"
"e-p:64:64-p1:64:64-p2:64:64-p3:32:32-p4:32:32-p5:32:32"
"-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128"
"-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64";
@ -2077,7 +2077,7 @@ class AMDGPUTargetInfo final : public TargetInfo {
Generic = 0;
Global = 1;
Local = 3;
Constant = 4;
Constant = 2;
Private = 5;
} else {
Generic = 4;

View File

@ -1,4 +1,6 @@
// RUN: %clang_cc1 %s -ffake-address-space-map -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 %s -triple amdgcn-amd-amdhsa-opencl -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 %s -triple amdgcn-amd-amdhsa-amdgizcl -emit-llvm -o - | FileCheck %s
typedef struct {
int i;

View File

@ -4,6 +4,6 @@
// RUN: %clang_cc1 %s -O0 -triple amdgcn---amdgizcl -emit-llvm -o - | FileCheck -check-prefix=GIZ %s
// CHECK: target datalayout = "e-p:32:32-p1:64:64-p2:64:64-p3:32:32-p4:64:64-p5:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64"
// GIZ: target datalayout = "e-p:64:64-p1:64:64-p2:64:64-p3:32:32-p4:64:64-p5:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64"
// GIZ: target datalayout = "e-p:64:64-p1:64:64-p2:64:64-p3:32:32-p4:32:32-p5:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64"
void foo(void) {}