Index: include/llvm/ADT/Triple.h =================================================================== --- include/llvm/ADT/Triple.h +++ include/llvm/ADT/Triple.h @@ -199,7 +199,9 @@ AMDOpenCL, CoreCLR, OpenCL, - LastEnvironmentType = OpenCL + AMDGIZ, + AMDGIZCL, + LastEnvironmentType = AMDGIZCL, }; enum ObjectFormatType { UnknownObjectFormat, Index: lib/Support/Triple.cpp =================================================================== --- lib/Support/Triple.cpp +++ lib/Support/Triple.cpp @@ -224,6 +224,8 @@ case Itanium: return "itanium"; case Cygnus: return "cygnus"; case AMDOpenCL: return "amdopencl"; + case AMDGIZ: return "amdgiz"; + case AMDGIZCL: return "amdgizcl"; case CoreCLR: return "coreclr"; case OpenCL: return "opencl"; } @@ -500,6 +502,8 @@ .StartsWith("itanium", Triple::Itanium) .StartsWith("cygnus", Triple::Cygnus) .StartsWith("amdopencl", Triple::AMDOpenCL) + .StartsWith("amdgiz", Triple::AMDGIZ) + .StartsWith("amdgizcl", Triple::AMDGIZCL) .StartsWith("coreclr", Triple::CoreCLR) .StartsWith("opencl", Triple::OpenCL) .Default(Triple::UnknownEnvironment); Index: lib/Target/AMDGPU/AMDGPUTargetMachine.cpp =================================================================== --- lib/Target/AMDGPU/AMDGPUTargetMachine.cpp +++ lib/Target/AMDGPU/AMDGPUTargetMachine.cpp @@ -177,9 +177,14 @@ // 32-bit private, local, and region pointers. 64-bit global, constant and // flat. - return "e-p:32:32-p1:64:64-p2:64:64-p3:32:32-p4:64:64-p5:32:32" + if (TT.getEnvironment() == Triple::AMDGIZ || + TT.getEnvironment() == Triple::AMDGIZCL) + return "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"; + return "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"; } LLVM_READNONE Index: test/CodeGen/AMDGPU/env-amdgiz.ll =================================================================== --- /dev/null +++ test/CodeGen/AMDGPU/env-amdgiz.ll @@ -0,0 +1,11 @@ +; RUN: llc -march=amdgcn -mtriple=amdgcn-amd-amdhsa-amdgiz -verify-machineinstrs < %s +; Just check the target feature and data layout is accepted without error. + +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" +target triple = "amdgcn-amd-amdhsa-amdgiz" + +define void @foo() { +entry: + ret void +} + Index: test/CodeGen/AMDGPU/env-amdgizcl.ll =================================================================== --- /dev/null +++ test/CodeGen/AMDGPU/env-amdgizcl.ll @@ -0,0 +1,11 @@ +; RUN: llc -march=amdgcn -mtriple=amdgcn-amd-amdhsa-amdgizcl -verify-machineinstrs < %s +; Just check the target feature and data layout is accepted without error. + +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" +target triple = "amdgcn-amd-amdhsa-amdgizcl" + +define void @foo() { +entry: + ret void +} +