Author: Tim Renouf
Date: 2020-10-10T17:22:22+01:00
New Revision: 666ef0db208bb3880115bdc133e72e954ed55300

URL: 
https://github.com/llvm/llvm-project/commit/666ef0db208bb3880115bdc133e72e954ed55300
DIFF: 
https://github.com/llvm/llvm-project/commit/666ef0db208bb3880115bdc133e72e954ed55300.diff

LOG: [AMDGPU] Add gfx602, gfx705, gfx805 targets

At AMD, in an internal audit of our code, we found some corner cases
where we were not quite differentiating targets enough for some old
hardware. This commit is part of fixing that by adding three new
targets:

* The "Oland" and "Hainan" variants of gfx601 are now split out into
  gfx602. LLPC (in the GPUOpen driver) and other front-ends could use
  that to avoid using the shaderZExport workaround on gfx602.

* One variant of gfx703 is now split out into gfx705. LLPC and other
  front-ends could use that to avoid using the
  shaderSpiCsRegAllocFragmentation workaround on gfx705.

* The "TongaPro" variant of gfx802 is now split out into gfx805.
  TongaPro has a faster 64-bit shift than its former friends in gfx802,
  and a subtarget feature could be set up for that to take advantage of
  it. This commit does not make that change; it just adds the target.

V2: Add clang changes. Put TargetParser list in order.
V3: AMDGCNGPUs table in TargetParser.cpp needs to be in GPUKind order,
    so fix the GPUKind order.

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

Change-Id: Ia901a7157eb2f73ccd9f25dbacec38427312377d

Added: 
    

Modified: 
    clang/include/clang/Basic/Cuda.h
    clang/lib/Basic/Cuda.cpp
    clang/lib/Basic/Targets/AMDGPU.cpp
    clang/lib/Basic/Targets/NVPTX.cpp
    clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
    clang/test/CodeGenOpenCL/amdgpu-features.cl
    clang/test/Driver/amdgpu-macros.cl
    clang/test/Driver/amdgpu-mcpu.cl
    clang/test/Driver/cuda-arch-translation.cu
    clang/test/Misc/target-invalid-cpu-note.c
    llvm/docs/AMDGPUUsage.rst
    llvm/include/llvm/BinaryFormat/ELF.h
    llvm/include/llvm/Support/TargetParser.h
    llvm/lib/Object/ELFObjectFile.cpp
    llvm/lib/ObjectYAML/ELFYAML.cpp
    llvm/lib/Support/TargetParser.cpp
    llvm/lib/Target/AMDGPU/AMDGPU.td
    llvm/lib/Target/AMDGPU/GCNProcessors.td
    llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
    llvm/test/CodeGen/AMDGPU/directive-amdgcn-target.ll
    llvm/test/CodeGen/AMDGPU/elf-header-flags-mach.ll
    llvm/test/Object/AMDGPU/elf-header-flags-mach.yaml
    llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-headers.test
    llvm/tools/llvm-readobj/ELFDumper.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/Cuda.h 
b/clang/include/clang/Basic/Cuda.h
index 93394f31abdc..417d40c28adf 100644
--- a/clang/include/clang/Basic/Cuda.h
+++ b/clang/include/clang/Basic/Cuda.h
@@ -57,14 +57,17 @@ enum class CudaArch {
   SM_80,
   GFX600,
   GFX601,
+  GFX602,
   GFX700,
   GFX701,
   GFX702,
   GFX703,
   GFX704,
+  GFX705,
   GFX801,
   GFX802,
   GFX803,
+  GFX805,
   GFX810,
   GFX900,
   GFX902,

diff  --git a/clang/lib/Basic/Cuda.cpp b/clang/lib/Basic/Cuda.cpp
index 7de42c1b90e5..42a8a097b1fd 100644
--- a/clang/lib/Basic/Cuda.cpp
+++ b/clang/lib/Basic/Cuda.cpp
@@ -73,15 +73,18 @@ CudaArchToStringMap arch_names[] = {
     SM(75),                          // Turing
     SM(80),                          // Ampere
     GFX(600), // tahiti
-    GFX(601), // pitcairn, verde, oland,hainan
+    GFX(601), // pitcairn, verde
+    GFX(602), // oland, hainan
     GFX(700), // kaveri
     GFX(701), // hawaii
     GFX(702), // 290,290x,R390,R390x
     GFX(703), // kabini mullins
     GFX(704), // bonaire
+    GFX(705),
     GFX(801), // carrizo
     GFX(802), // tonga,iceland
     GFX(803), // fiji,polaris10
+    GFX(805), // tongapro
     GFX(810), // stoney
     GFX(900), // vega, instinct
     GFX(902), GFX(904), GFX(906), GFX(908), GFX(909),

diff  --git a/clang/lib/Basic/Targets/AMDGPU.cpp 
b/clang/lib/Basic/Targets/AMDGPU.cpp
index ba9be72af971..42db207b9ce5 100644
--- a/clang/lib/Basic/Targets/AMDGPU.cpp
+++ b/clang/lib/Basic/Targets/AMDGPU.cpp
@@ -228,6 +228,7 @@ bool AMDGPUTargetInfo::initFeatureMap(
       Features["gfx9-insts"] = true;
       LLVM_FALLTHROUGH;
     case GK_GFX810:
+    case GK_GFX805:
     case GK_GFX803:
     case GK_GFX802:
     case GK_GFX801:
@@ -236,6 +237,7 @@ bool AMDGPUTargetInfo::initFeatureMap(
       Features["dpp"] = true;
       Features["s-memrealtime"] = true;
       LLVM_FALLTHROUGH;
+    case GK_GFX705:
     case GK_GFX704:
     case GK_GFX703:
     case GK_GFX702:
@@ -244,6 +246,7 @@ bool AMDGPUTargetInfo::initFeatureMap(
       Features["ci-insts"] = true;
       Features["flat-address-space"] = true;
       LLVM_FALLTHROUGH;
+    case GK_GFX602:
     case GK_GFX601:
     case GK_GFX600:
       break;

diff  --git a/clang/lib/Basic/Targets/NVPTX.cpp 
b/clang/lib/Basic/Targets/NVPTX.cpp
index aae89477e97d..3780f1cc250c 100644
--- a/clang/lib/Basic/Targets/NVPTX.cpp
+++ b/clang/lib/Basic/Targets/NVPTX.cpp
@@ -182,14 +182,17 @@ void NVPTXTargetInfo::getTargetDefines(const LangOptions 
&Opts,
       switch (GPU) {
       case CudaArch::GFX600:
       case CudaArch::GFX601:
+      case CudaArch::GFX602:
       case CudaArch::GFX700:
       case CudaArch::GFX701:
       case CudaArch::GFX702:
       case CudaArch::GFX703:
       case CudaArch::GFX704:
+      case CudaArch::GFX705:
       case CudaArch::GFX801:
       case CudaArch::GFX802:
       case CudaArch::GFX803:
+      case CudaArch::GFX805:
       case CudaArch::GFX810:
       case CudaArch::GFX900:
       case CudaArch::GFX902:

diff  --git a/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp 
b/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
index 3c4849aa0970..ab7ee8b33a0c 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
@@ -4622,14 +4622,17 @@ void CGOpenMPRuntimeGPU::processRequiresDirective(
       case CudaArch::SM_80:
       case CudaArch::GFX600:
       case CudaArch::GFX601:
+      case CudaArch::GFX602:
       case CudaArch::GFX700:
       case CudaArch::GFX701:
       case CudaArch::GFX702:
       case CudaArch::GFX703:
       case CudaArch::GFX704:
+      case CudaArch::GFX705:
       case CudaArch::GFX801:
       case CudaArch::GFX802:
       case CudaArch::GFX803:
+      case CudaArch::GFX805:
       case CudaArch::GFX810:
       case CudaArch::GFX900:
       case CudaArch::GFX902:
@@ -4684,14 +4687,17 @@ static std::pair<unsigned, unsigned> 
getSMsBlocksPerSM(CodeGenModule &CGM) {
     return {84, 32};
   case CudaArch::GFX600:
   case CudaArch::GFX601:
+  case CudaArch::GFX602:
   case CudaArch::GFX700:
   case CudaArch::GFX701:
   case CudaArch::GFX702:
   case CudaArch::GFX703:
   case CudaArch::GFX704:
+  case CudaArch::GFX705:
   case CudaArch::GFX801:
   case CudaArch::GFX802:
   case CudaArch::GFX803:
+  case CudaArch::GFX805:
   case CudaArch::GFX810:
   case CudaArch::GFX900:
   case CudaArch::GFX902:

diff  --git a/clang/test/CodeGenOpenCL/amdgpu-features.cl 
b/clang/test/CodeGenOpenCL/amdgpu-features.cl
index 93357a48eb89..5a814f36e564 100644
--- a/clang/test/CodeGenOpenCL/amdgpu-features.cl
+++ b/clang/test/CodeGenOpenCL/amdgpu-features.cl
@@ -5,6 +5,7 @@
 
 // RUN: %clang_cc1 -triple amdgcn -target-cpu gfx600 -S -emit-llvm -o - %s | 
FileCheck --check-prefix=GFX600 %s
 // RUN: %clang_cc1 -triple amdgcn -target-cpu gfx601 -S -emit-llvm -o - %s | 
FileCheck --check-prefix=GFX601 %s
+// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx602 -S -emit-llvm -o - %s | 
FileCheck --check-prefix=GFX602 %s
 // RUN: %clang_cc1 -triple amdgcn -target-cpu gfx700 -S -emit-llvm -o - %s | 
FileCheck --check-prefix=GFX700 %s
 // RUN: %clang_cc1 -triple amdgcn -target-cpu gfx801 -S -emit-llvm -o - %s | 
FileCheck --check-prefix=GFX801 %s
 // RUN: %clang_cc1 -triple amdgcn -target-cpu gfx904 -S -emit-llvm -o - %s | 
FileCheck --check-prefix=GFX904 %s
@@ -18,6 +19,7 @@
 
 // GFX600-NOT: "target-features"
 // GFX601-NOT: "target-features"
+// GFX602-NOT: "target-features"
 // GFX700: "target-features"="+ci-insts,+flat-address-space"
 // GFX801: 
"target-features"="+16-bit-insts,+ci-insts,+dpp,+flat-address-space,+gfx8-insts,+s-memrealtime"
 // GFX904: 
"target-features"="+16-bit-insts,+ci-insts,+dpp,+flat-address-space,+gfx8-insts,+gfx9-insts,+s-memrealtime"

diff  --git a/clang/test/Driver/amdgpu-macros.cl 
b/clang/test/Driver/amdgpu-macros.cl
index 71f96d4981d7..8c9c71f3e258 100644
--- a/clang/test/Driver/amdgpu-macros.cl
+++ b/clang/test/Driver/amdgpu-macros.cl
@@ -146,10 +146,11 @@
 // RUN: %clang -E -dM -target amdgcn -mcpu=gfx600 %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX600 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=tahiti %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX600 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=gfx601 %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX601 %s
-// RUN: %clang -E -dM -target amdgcn -mcpu=hainan %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX601 %s
-// RUN: %clang -E -dM -target amdgcn -mcpu=oland %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX601 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=pitcairn %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX601 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=verde %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX601 %s
+// RUN: %clang -E -dM -target amdgcn -mcpu=gfx602 %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX602 %s
+// RUN: %clang -E -dM -target amdgcn -mcpu=hainan %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX602 %s
+// RUN: %clang -E -dM -target amdgcn -mcpu=oland %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX602 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=gfx700 %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX700 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=kaveri %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX700 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=gfx701 %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX701 %s
@@ -160,6 +161,7 @@
 // RUN: %clang -E -dM -target amdgcn -mcpu=mullins %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX703 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=gfx704 %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX704 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=bonaire %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX704 %s
+// RUN: %clang -E -dM -target amdgcn -mcpu=gfx705 %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX705 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=gfx801 %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX801 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=carrizo %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX801 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=gfx802 %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX802 %s
@@ -169,6 +171,8 @@
 // RUN: %clang -E -dM -target amdgcn -mcpu=fiji %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX803 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=polaris10 %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX803 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=polaris11 %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX803 %s
+// RUN: %clang -E -dM -target amdgcn -mcpu=gfx805 %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX805 %s
+// RUN: %clang -E -dM -target amdgcn -mcpu=tongapro %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX805 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=gfx810 %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX810 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=stoney %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX810 %s
 // RUN: %clang -E -dM -target amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck 
--check-prefixes=ARCH-GCN,GFX900 %s
@@ -185,14 +189,17 @@
 
 // GFX600-DAG: #define FP_FAST_FMA 1
 // GFX601-DAG: #define FP_FAST_FMA 1
+// GFX602-DAG: #define FP_FAST_FMA 1
 // GFX700-DAG: #define FP_FAST_FMA 1
 // GFX701-DAG: #define FP_FAST_FMA 1
 // GFX702-DAG: #define FP_FAST_FMA 1
 // GFX703-DAG: #define FP_FAST_FMA 1
 // GFX704-DAG: #define FP_FAST_FMA 1
+// GFX705-DAG: #define FP_FAST_FMA 1
 // GFX801-DAG: #define FP_FAST_FMA 1
 // GFX802-DAG: #define FP_FAST_FMA 1
 // GFX803-DAG: #define FP_FAST_FMA 1
+// GFX805-DAG: #define FP_FAST_FMA 1
 // GFX810-DAG: #define FP_FAST_FMA 1
 // GFX900-DAG: #define FP_FAST_FMA 1
 // GFX902-DAG: #define FP_FAST_FMA 1
@@ -208,14 +215,17 @@
 
 // GFX600-DAG: #define FP_FAST_FMAF 1
 // GFX601-NOT: #define FP_FAST_FMAF 1
+// GFX602-NOT: #define FP_FAST_FMAF 1
 // GFX700-NOT: #define FP_FAST_FMAF 1
 // GFX701-DAG: #define FP_FAST_FMAF 1
 // GFX702-DAG: #define FP_FAST_FMAF 1
 // GFX703-NOT: #define FP_FAST_FMAF 1
 // GFX704-NOT: #define FP_FAST_FMAF 1
+// GFX705-NOT: #define FP_FAST_FMAF 1
 // GFX801-DAG: #define FP_FAST_FMAF 1
 // GFX802-NOT: #define FP_FAST_FMAF 1
 // GFX803-NOT: #define FP_FAST_FMAF 1
+// GFX805-NOT: #define FP_FAST_FMAF 1
 // GFX810-NOT: #define FP_FAST_FMAF 1
 // GFX900-DAG: #define FP_FAST_FMAF 1
 // GFX902-DAG: #define FP_FAST_FMAF 1
@@ -235,14 +245,17 @@
 
 // GFX600-DAG: #define __HAS_FMAF__ 1
 // GFX601-DAG: #define __HAS_FMAF__ 1
+// GFX602-DAG: #define __HAS_FMAF__ 1
 // GFX700-DAG: #define __HAS_FMAF__ 1
 // GFX701-DAG: #define __HAS_FMAF__ 1
 // GFX702-DAG: #define __HAS_FMAF__ 1
 // GFX703-DAG: #define __HAS_FMAF__ 1
 // GFX704-DAG: #define __HAS_FMAF__ 1
+// GFX705-DAG: #define __HAS_FMAF__ 1
 // GFX801-DAG: #define __HAS_FMAF__ 1
 // GFX802-DAG: #define __HAS_FMAF__ 1
 // GFX803-DAG: #define __HAS_FMAF__ 1
+// GFX805-DAG: #define __HAS_FMAF__ 1
 // GFX810-DAG: #define __HAS_FMAF__ 1
 // GFX900-DAG: #define __HAS_FMAF__ 1
 // GFX902-DAG: #define __HAS_FMAF__ 1
@@ -258,14 +271,17 @@
 
 // GFX600-DAG: #define __HAS_FP64__ 1
 // GFX601-DAG: #define __HAS_FP64__ 1
+// GFX602-DAG: #define __HAS_FP64__ 1
 // GFX700-DAG: #define __HAS_FP64__ 1
 // GFX701-DAG: #define __HAS_FP64__ 1
 // GFX702-DAG: #define __HAS_FP64__ 1
 // GFX703-DAG: #define __HAS_FP64__ 1
 // GFX704-DAG: #define __HAS_FP64__ 1
+// GFX705-DAG: #define __HAS_FP64__ 1
 // GFX801-DAG: #define __HAS_FP64__ 1
 // GFX802-DAG: #define __HAS_FP64__ 1
 // GFX803-DAG: #define __HAS_FP64__ 1
+// GFX805-DAG: #define __HAS_FP64__ 1
 // GFX810-DAG: #define __HAS_FP64__ 1
 // GFX900-DAG: #define __HAS_FP64__ 1
 // GFX902-DAG: #define __HAS_FP64__ 1
@@ -281,14 +297,17 @@
 
 // GFX600-DAG: #define __HAS_LDEXPF__ 1
 // GFX601-DAG: #define __HAS_LDEXPF__ 1
+// GFX602-DAG: #define __HAS_LDEXPF__ 1
 // GFX700-DAG: #define __HAS_LDEXPF__ 1
 // GFX701-DAG: #define __HAS_LDEXPF__ 1
 // GFX702-DAG: #define __HAS_LDEXPF__ 1
 // GFX703-DAG: #define __HAS_LDEXPF__ 1
 // GFX704-DAG: #define __HAS_LDEXPF__ 1
+// GFX705-DAG: #define __HAS_LDEXPF__ 1
 // GFX801-DAG: #define __HAS_LDEXPF__ 1
 // GFX802-DAG: #define __HAS_LDEXPF__ 1
 // GFX803-DAG: #define __HAS_LDEXPF__ 1
+// GFX805-DAG: #define __HAS_LDEXPF__ 1
 // GFX810-DAG: #define __HAS_LDEXPF__ 1
 // GFX900-DAG: #define __HAS_LDEXPF__ 1
 // GFX902-DAG: #define __HAS_LDEXPF__ 1
@@ -304,14 +323,17 @@
 
 // GFX600-DAG: #define __gfx600__ 1
 // GFX601-DAG: #define __gfx601__ 1
+// GFX602-DAG: #define __gfx602__ 1
 // GFX700-DAG: #define __gfx700__ 1
 // GFX701-DAG: #define __gfx701__ 1
 // GFX702-DAG: #define __gfx702__ 1
 // GFX703-DAG: #define __gfx703__ 1
 // GFX704-DAG: #define __gfx704__ 1
+// GFX705-DAG: #define __gfx705__ 1
 // GFX801-DAG: #define __gfx801__ 1
 // GFX802-DAG: #define __gfx802__ 1
 // GFX803-DAG: #define __gfx803__ 1
+// GFX805-DAG: #define __gfx805__ 1
 // GFX810-DAG: #define __gfx810__ 1
 // GFX900-DAG: #define __gfx900__ 1
 // GFX902-DAG: #define __gfx902__ 1
@@ -327,14 +349,17 @@
 
 // GFX600-DAG: #define __amdgcn_processor__ "gfx600"
 // GFX601-DAG: #define __amdgcn_processor__ "gfx601"
+// GFX602-DAG: #define __amdgcn_processor__ "gfx602"
 // GFX700-DAG: #define __amdgcn_processor__ "gfx700"
 // GFX701-DAG: #define __amdgcn_processor__ "gfx701"
 // GFX702-DAG: #define __amdgcn_processor__ "gfx702"
 // GFX703-DAG: #define __amdgcn_processor__ "gfx703"
 // GFX704-DAG: #define __amdgcn_processor__ "gfx704"
+// GFX705-DAG: #define __amdgcn_processor__ "gfx705"
 // GFX801-DAG: #define __amdgcn_processor__ "gfx801"
 // GFX802-DAG: #define __amdgcn_processor__ "gfx802"
 // GFX803-DAG: #define __amdgcn_processor__ "gfx803"
+// GFX805-DAG: #define __amdgcn_processor__ "gfx805"
 // GFX810-DAG: #define __amdgcn_processor__ "gfx810"
 // GFX900-DAG: #define __amdgcn_processor__ "gfx900"
 // GFX902-DAG: #define __amdgcn_processor__ "gfx902"
@@ -350,14 +375,17 @@
 
 // GFX600-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
 // GFX601-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
+// GFX602-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
 // GFX700-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
 // GFX701-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
 // GFX702-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
 // GFX703-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
 // GFX704-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
+// GFX705-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
 // GFX801-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
 // GFX802-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
 // GFX803-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
+// GFX805-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
 // GFX810-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
 // GFX900-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64
 // GFX902-DAG: #define __AMDGCN_WAVEFRONT_SIZE 64

diff  --git a/clang/test/Driver/amdgpu-mcpu.cl 
b/clang/test/Driver/amdgpu-mcpu.cl
index bfc08e6718e9..e43082eabc0d 100644
--- a/clang/test/Driver/amdgpu-mcpu.cl
+++ b/clang/test/Driver/amdgpu-mcpu.cl
@@ -56,10 +56,11 @@
 // RUN: %clang -### -target amdgcn -mcpu=gfx600 %s 2>&1 | FileCheck 
--check-prefix=GFX600 %s
 // RUN: %clang -### -target amdgcn -mcpu=tahiti %s 2>&1 | FileCheck 
--check-prefix=GFX600 %s
 // RUN: %clang -### -target amdgcn -mcpu=gfx601 %s 2>&1 | FileCheck 
--check-prefix=GFX601 %s
-// RUN: %clang -### -target amdgcn -mcpu=hainan %s 2>&1 | FileCheck 
--check-prefix=GFX601 %s
-// RUN: %clang -### -target amdgcn -mcpu=oland %s 2>&1 | FileCheck 
--check-prefix=GFX601 %s
 // RUN: %clang -### -target amdgcn -mcpu=pitcairn %s 2>&1 | FileCheck 
--check-prefix=GFX601 %s
 // RUN: %clang -### -target amdgcn -mcpu=verde %s 2>&1 | FileCheck 
--check-prefix=GFX601 %s
+// RUN: %clang -### -target amdgcn -mcpu=gfx602 %s 2>&1 | FileCheck 
--check-prefix=GFX602 %s
+// RUN: %clang -### -target amdgcn -mcpu=hainan %s 2>&1 | FileCheck 
--check-prefix=GFX602 %s
+// RUN: %clang -### -target amdgcn -mcpu=oland %s 2>&1 | FileCheck 
--check-prefix=GFX602 %s
 // RUN: %clang -### -target amdgcn -mcpu=gfx700 %s 2>&1 | FileCheck 
--check-prefix=GFX700 %s
 // RUN: %clang -### -target amdgcn -mcpu=kaveri %s 2>&1 | FileCheck 
--check-prefix=GFX700 %s
 // RUN: %clang -### -target amdgcn -mcpu=gfx701 %s 2>&1 | FileCheck 
--check-prefix=GFX701 %s
@@ -70,6 +71,7 @@
 // RUN: %clang -### -target amdgcn -mcpu=mullins %s 2>&1 | FileCheck 
--check-prefix=GFX703 %s
 // RUN: %clang -### -target amdgcn -mcpu=gfx704 %s 2>&1 | FileCheck 
--check-prefix=GFX704 %s
 // RUN: %clang -### -target amdgcn -mcpu=bonaire %s 2>&1 | FileCheck 
--check-prefix=GFX704 %s
+// RUN: %clang -### -target amdgcn -mcpu=gfx705 %s 2>&1 | FileCheck 
--check-prefix=GFX705 %s
 // RUN: %clang -### -target amdgcn -mcpu=gfx801 %s 2>&1 | FileCheck 
--check-prefix=GFX801 %s
 // RUN: %clang -### -target amdgcn -mcpu=carrizo %s 2>&1 | FileCheck 
--check-prefix=GFX801 %s
 // RUN: %clang -### -target amdgcn -mcpu=gfx802 %s 2>&1 | FileCheck 
--check-prefix=GFX802 %s
@@ -79,6 +81,7 @@
 // RUN: %clang -### -target amdgcn -mcpu=fiji %s 2>&1 | FileCheck 
--check-prefix=GFX803 %s
 // RUN: %clang -### -target amdgcn -mcpu=polaris10 %s 2>&1 | FileCheck 
--check-prefix=GFX803 %s
 // RUN: %clang -### -target amdgcn -mcpu=polaris11 %s 2>&1 | FileCheck 
--check-prefix=GFX803 %s
+// RUN: %clang -### -target amdgcn -mcpu=gfx805 %s 2>&1 | FileCheck 
--check-prefix=GFX805 %s
 // RUN: %clang -### -target amdgcn -mcpu=gfx810 %s 2>&1 | FileCheck 
--check-prefix=GFX810 %s
 // RUN: %clang -### -target amdgcn -mcpu=stoney %s 2>&1 | FileCheck 
--check-prefix=GFX810 %s
 // RUN: %clang -### -target amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck 
--check-prefix=GFX900 %s
@@ -96,14 +99,17 @@
 // GCNDEFAULT-NOT: -target-cpu
 // GFX600:    "-target-cpu" "gfx600"
 // GFX601:    "-target-cpu" "gfx601"
+// GFX602:    "-target-cpu" "gfx602"
 // GFX700:    "-target-cpu" "gfx700"
 // GFX701:    "-target-cpu" "gfx701"
 // GFX702:    "-target-cpu" "gfx702"
 // GFX703:    "-target-cpu" "gfx703"
 // GFX704:    "-target-cpu" "gfx704"
+// GFX705:    "-target-cpu" "gfx705"
 // GFX801:    "-target-cpu" "gfx801"
 // GFX802:    "-target-cpu" "gfx802"
 // GFX803:    "-target-cpu" "gfx803"
+// GFX805:    "-target-cpu" "gfx805"
 // GFX810:    "-target-cpu" "gfx810"
 // GFX900:    "-target-cpu" "gfx900"
 // GFX902:    "-target-cpu" "gfx902"

diff  --git a/clang/test/Driver/cuda-arch-translation.cu 
b/clang/test/Driver/cuda-arch-translation.cu
index 49b87e7b4fb8..b574d082218e 100644
--- a/clang/test/Driver/cuda-arch-translation.cu
+++ b/clang/test/Driver/cuda-arch-translation.cu
@@ -35,6 +35,8 @@
 // RUN: | FileCheck -check-prefixes=COMMON,GFX600 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx601 %s 2>&1 
\
 // RUN: | FileCheck -check-prefixes=COMMON,GFX601 %s
+// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx602 %s 2>&1 
\
+// RUN: | FileCheck -check-prefixes=COMMON,GFX602 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx700 %s 2>&1 
\
 // RUN: | FileCheck -check-prefixes=COMMON,GFX700 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx701 %s 2>&1 
\
@@ -45,12 +47,16 @@
 // RUN: | FileCheck -check-prefixes=COMMON,GFX703 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx704 %s 2>&1 
\
 // RUN: | FileCheck -check-prefixes=COMMON,GFX704 %s
+// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx705 %s 2>&1 
\
+// RUN: | FileCheck -check-prefixes=COMMON,GFX705 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx801 %s 2>&1 
\
 // RUN: | FileCheck -check-prefixes=COMMON,GFX801 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx802 %s 2>&1 
\
 // RUN: | FileCheck -check-prefixes=COMMON,GFX802 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx803 %s 2>&1 
\
 // RUN: | FileCheck -check-prefixes=COMMON,GFX803 %s
+// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx805 %s 2>&1 
\
+// RUN: | FileCheck -check-prefixes=COMMON,GFX805 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx810 %s 2>&1 
\
 // RUN: | FileCheck -check-prefixes=COMMON,GFX810 %s
 // RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx900 %s 2>&1 
\
@@ -77,14 +83,17 @@
 // SM70:--image=profile=sm_70{{.*}}--image=profile=compute_70
 // GFX600:--image=profile=gfx600{{.*}}--image=profile=compute_amdgcn
 // GFX601:--image=profile=gfx601{{.*}}--image=profile=compute_amdgcn
+// GFX602:--image=profile=gfx602{{.*}}--image=profile=compute_amdgcn
 // GFX700:--image=profile=gfx700{{.*}}--image=profile=compute_amdgcn
 // GFX701:--image=profile=gfx701{{.*}}--image=profile=compute_amdgcn
 // GFX702:--image=profile=gfx702{{.*}}--image=profile=compute_amdgcn
 // GFX703:--image=profile=gfx703{{.*}}--image=profile=compute_amdgcn
 // GFX704:--image=profile=gfx704{{.*}}--image=profile=compute_amdgcn
+// GFX705:--image=profile=gfx705{{.*}}--image=profile=compute_amdgcn
 // GFX801:--image=profile=gfx801{{.*}}--image=profile=compute_amdgcn
 // GFX802:--image=profile=gfx802{{.*}}--image=profile=compute_amdgcn
 // GFX803:--image=profile=gfx803{{.*}}--image=profile=compute_amdgcn
+// GFX805:--image=profile=gfx805{{.*}}--image=profile=compute_amdgcn
 // GFX810:--image=profile=gfx810{{.*}}--image=profile=compute_amdgcn
 // GFX900:--image=profile=gfx900{{.*}}--image=profile=compute_amdgcn
 // GFX902:--image=profile=gfx902{{.*}}--image=profile=compute_amdgcn

diff  --git a/clang/test/Misc/target-invalid-cpu-note.c 
b/clang/test/Misc/target-invalid-cpu-note.c
index 309cb637c0c5..4f5dbac133cb 100644
--- a/clang/test/Misc/target-invalid-cpu-note.c
+++ b/clang/test/Misc/target-invalid-cpu-note.c
@@ -80,11 +80,11 @@
 
 // RUN: not %clang_cc1 -triple amdgcn--- -target-cpu not-a-cpu -fsyntax-only 
%s 2>&1 | FileCheck %s --check-prefix AMDGCN
 // AMDGCN: error: unknown target CPU 'not-a-cpu'
-// AMDGCN: note: valid target CPU values are: gfx600, tahiti, gfx601, hainan,
-// AMDGCN-SAME: oland, pitcairn, verde, gfx700, kaveri, gfx701, hawaii, gfx702,
-// AMDGCN-SAME: gfx703, kabini, mullins, gfx704, bonaire, gfx801, carrizo, 
+// AMDGCN: note: valid target CPU values are: gfx600, tahiti, gfx601, 
pitcairn, verde,
+// AMDGCN-SAME: gfx602, hainan, oland, gfx700, kaveri, gfx701, hawaii, gfx702,
+// AMDGCN-SAME: gfx703, kabini, mullins, gfx704, bonaire, gfx705, gfx801, 
carrizo, 
 // AMDGCN-SAME: gfx802, iceland, tonga, gfx803, fiji, polaris10, polaris11,
-// AMDGCN-SAME: gfx810, stoney, gfx900, gfx902
+// AMDGCN-SAME: gfx805, tongapro, gfx810, stoney, gfx900, gfx902
 
 // RUN: not %clang_cc1 -triple wasm64--- -target-cpu not-a-cpu -fsyntax-only 
%s 2>&1 | FileCheck %s --check-prefix WEBASM
 // WEBASM: error: unknown target CPU 'not-a-cpu'

diff  --git a/llvm/docs/AMDGPUUsage.rst b/llvm/docs/AMDGPUUsage.rst
index 10f6a3e49509..f2b605fb3563 100644
--- a/llvm/docs/AMDGPUUsage.rst
+++ b/llvm/docs/AMDGPUUsage.rst
@@ -129,10 +129,10 @@ names from both the *Processor* and *Alternative 
Processor* can be used.
      **GCN GFX6 (Southern Islands (SI))** [AMD-GCN-GFX6]_
      
-----------------------------------------------------------------------------------------------
      ``gfx600``  - ``tahiti``    ``amdgcn``   dGPU
-     ``gfx601``  - ``hainan``    ``amdgcn``   dGPU
-                 - ``oland``
-                 - ``pitcairn``
+     ``gfx601``  - ``pitcairn``  ``amdgcn``   dGPU
                  - ``verde``
+     ``gfx602``  - ``hainan``    ``amdgcn``   dGPU
+                 - ``oland``
      **GCN GFX7 (Sea Islands (CI))** [AMD-GCN-GFX7]_
      
-----------------------------------------------------------------------------------------------
      ``gfx700``  - ``kaveri``    ``amdgcn``   APU                             
- A6-7000
@@ -166,6 +166,7 @@ names from both the *Processor* and *Alternative Processor* 
can be used.
                                                                               
- Radeon HD 8770
                                                                               
- R7 260
                                                                               
- R7 260X
+     ``gfx705``                  ``amdgcn``   APU
      **GCN GFX8 (Volcanic Islands (VI))** [AMD-GCN-GFX8]_
      
-----------------------------------------------------------------------------------------------
      ``gfx801``  - ``carrizo``   ``amdgcn``   APU   - xnack                   
- A6-8500P
@@ -186,14 +187,9 @@ names from both the *Processor* and *Alternative 
Processor* can be used.
      \                           ``amdgcn``   APU   - xnack                   
- E2-9010
                                                       [on]                    
- A6-9210
                                                                               
- A9-9410
-     ``gfx802``  - ``iceland``   ``amdgcn``   dGPU  - xnack           ROCm    
- FirePro S7150
-                 - ``tonga``                          [off]                   
- FirePro S7100
-                                                                              
- FirePro W7100
-                                                                              
- Radeon R285
-                                                                              
- Radeon R9 380
+     ``gfx802``  - ``iceland``   ``amdgcn``   dGPU  - xnack           ROCm    
- Radeon R285
+                 - ``tonga``                          [off]                   
- Radeon R9 380
                                                                               
- Radeon R9 385
-                                                                              
- Mobile FirePro
-                                                                               
 M7170
      ``gfx803``  - ``fiji``      ``amdgcn``   dGPU  - xnack           ROCm    
- Radeon R9 Nano
                                                       [off]                   
- Radeon R9 Fury
                                                                               
- Radeon R9 FuryX
@@ -205,6 +201,11 @@ names from both the *Processor* and *Alternative 
Processor* can be used.
                                                                               
- Radeon Instinct MI6
      \           - ``polaris11`` ``amdgcn``   dGPU  - xnack           ROCm    
- Radeon RX 460
                                                       [off]
+     ``gfx805``  - ``tongapro``  ``amdgcn``   dGPU  - xnack           ROCm    
- FirePro S7150
+                                                      [off]                   
- FirePro S7100
+                                                                              
- FirePro W7100
+                                                                              
- Mobile FirePro
+                                                                               
 M7170
      ``gfx810``  - ``stoney``    ``amdgcn``   APU   - xnack
                                                       [on]
      **GCN GFX9** [AMD-GCN-GFX9]_
@@ -818,6 +819,11 @@ The AMDGPU backend uses the following ELF header:
      ``EF_AMDGPU_MACH_AMDGCN_GFX1012`` 0x035      ``gfx1012``
      ``EF_AMDGPU_MACH_AMDGCN_GFX1030`` 0x036      ``gfx1030``
      ``EF_AMDGPU_MACH_AMDGCN_GFX1031`` 0x037      ``gfx1031``
+     *reserved*                        0x038      Reserved.
+     *reserved*                        0x039      Reserved.
+     ``EF_AMDGPU_MACH_AMDGCN_GFX602``  0x03a      ``gfx602``
+     ``EF_AMDGPU_MACH_AMDGCN_GFX705``  0x03b      ``gfx705``
+     ``EF_AMDGPU_MACH_AMDGCN_GFX805``  0x03c      ``gfx805``
      ================================= ========== =============================
 
 Sections

diff  --git a/llvm/include/llvm/BinaryFormat/ELF.h 
b/llvm/include/llvm/BinaryFormat/ELF.h
index 32757a9fb4c7..d800d16fdd3a 100644
--- a/llvm/include/llvm/BinaryFormat/ELF.h
+++ b/llvm/include/llvm/BinaryFormat/ELF.h
@@ -685,16 +685,19 @@ enum : unsigned {
   // AMDGCN GFX6.
   EF_AMDGPU_MACH_AMDGCN_GFX600 = 0x020,
   EF_AMDGPU_MACH_AMDGCN_GFX601 = 0x021,
+  EF_AMDGPU_MACH_AMDGCN_GFX602 = 0x03a,
   // AMDGCN GFX7.
   EF_AMDGPU_MACH_AMDGCN_GFX700 = 0x022,
   EF_AMDGPU_MACH_AMDGCN_GFX701 = 0x023,
   EF_AMDGPU_MACH_AMDGCN_GFX702 = 0x024,
   EF_AMDGPU_MACH_AMDGCN_GFX703 = 0x025,
   EF_AMDGPU_MACH_AMDGCN_GFX704 = 0x026,
+  EF_AMDGPU_MACH_AMDGCN_GFX705 = 0x03b,
   // AMDGCN GFX8.
   EF_AMDGPU_MACH_AMDGCN_GFX801 = 0x028,
   EF_AMDGPU_MACH_AMDGCN_GFX802 = 0x029,
   EF_AMDGPU_MACH_AMDGCN_GFX803 = 0x02a,
+  EF_AMDGPU_MACH_AMDGCN_GFX805 = 0x03c,
   EF_AMDGPU_MACH_AMDGCN_GFX810 = 0x02b,
   // AMDGCN GFX9.
   EF_AMDGPU_MACH_AMDGCN_GFX900 = 0x02c,
@@ -716,7 +719,7 @@ enum : unsigned {
 
   // First/last AMDGCN-based processors.
   EF_AMDGPU_MACH_AMDGCN_FIRST = EF_AMDGPU_MACH_AMDGCN_GFX600,
-  EF_AMDGPU_MACH_AMDGCN_LAST = EF_AMDGPU_MACH_AMDGCN_GFX1031,
+  EF_AMDGPU_MACH_AMDGCN_LAST = EF_AMDGPU_MACH_AMDGCN_GFX805,
 
   // Indicates if the "xnack" target feature is enabled for all code contained
   // in the object.

diff  --git a/llvm/include/llvm/Support/TargetParser.h 
b/llvm/include/llvm/Support/TargetParser.h
index dd2990895c21..260b77b52c5d 100644
--- a/llvm/include/llvm/Support/TargetParser.h
+++ b/llvm/include/llvm/Support/TargetParser.h
@@ -62,17 +62,20 @@ enum GPUKind : uint32_t {
   // AMDGCN-based processors.
   GK_GFX600 = 32,
   GK_GFX601 = 33,
+  GK_GFX602 = 34,
 
   GK_GFX700 = 40,
   GK_GFX701 = 41,
   GK_GFX702 = 42,
   GK_GFX703 = 43,
   GK_GFX704 = 44,
+  GK_GFX705 = 45,
 
   GK_GFX801 = 50,
   GK_GFX802 = 51,
   GK_GFX803 = 52,
-  GK_GFX810 = 53,
+  GK_GFX805 = 53,
+  GK_GFX810 = 54,
 
   GK_GFX900 = 60,
   GK_GFX902 = 61,

diff  --git a/llvm/lib/Object/ELFObjectFile.cpp 
b/llvm/lib/Object/ELFObjectFile.cpp
index 91ed60a814ab..1807a57e7dc1 100644
--- a/llvm/lib/Object/ELFObjectFile.cpp
+++ b/llvm/lib/Object/ELFObjectFile.cpp
@@ -414,6 +414,8 @@ StringRef ELFObjectFileBase::getAMDGPUCPUName() const {
     return "gfx600";
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX601:
     return "gfx601";
+  case ELF::EF_AMDGPU_MACH_AMDGCN_GFX602:
+    return "gfx602";
 
   // AMDGCN GFX7.
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX700:
@@ -426,6 +428,8 @@ StringRef ELFObjectFileBase::getAMDGPUCPUName() const {
     return "gfx703";
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX704:
     return "gfx704";
+  case ELF::EF_AMDGPU_MACH_AMDGCN_GFX705:
+    return "gfx705";
 
   // AMDGCN GFX8.
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX801:
@@ -434,6 +438,8 @@ StringRef ELFObjectFileBase::getAMDGPUCPUName() const {
     return "gfx802";
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX803:
     return "gfx803";
+  case ELF::EF_AMDGPU_MACH_AMDGCN_GFX805:
+    return "gfx805";
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX810:
     return "gfx810";
 

diff  --git a/llvm/lib/ObjectYAML/ELFYAML.cpp b/llvm/lib/ObjectYAML/ELFYAML.cpp
index 5e642d90ffc7..fe4c2746f063 100644
--- a/llvm/lib/ObjectYAML/ELFYAML.cpp
+++ b/llvm/lib/ObjectYAML/ELFYAML.cpp
@@ -421,14 +421,17 @@ void ScalarBitSetTraits<ELFYAML::ELF_EF>::bitset(IO &IO,
     BCaseMask(EF_AMDGPU_MACH_R600_TURKS, EF_AMDGPU_MACH);
     BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX600, EF_AMDGPU_MACH);
     BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX601, EF_AMDGPU_MACH);
+    BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX602, EF_AMDGPU_MACH);
     BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX700, EF_AMDGPU_MACH);
     BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX701, EF_AMDGPU_MACH);
     BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX702, EF_AMDGPU_MACH);
     BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX703, EF_AMDGPU_MACH);
     BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX704, EF_AMDGPU_MACH);
+    BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX705, EF_AMDGPU_MACH);
     BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX801, EF_AMDGPU_MACH);
     BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX802, EF_AMDGPU_MACH);
     BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX803, EF_AMDGPU_MACH);
+    BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX805, EF_AMDGPU_MACH);
     BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX810, EF_AMDGPU_MACH);
     BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX900, EF_AMDGPU_MACH);
     BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX902, EF_AMDGPU_MACH);

diff  --git a/llvm/lib/Support/TargetParser.cpp 
b/llvm/lib/Support/TargetParser.cpp
index 9c05c8244773..9d2be4bd8d76 100644
--- a/llvm/lib/Support/TargetParser.cpp
+++ b/llvm/lib/Support/TargetParser.cpp
@@ -63,16 +63,17 @@ constexpr GPUInfo R600GPUs[26] = {
 
 // This table should be sorted by the value of GPUKind
 // Don't bother listing the implicitly true features
-constexpr GPUInfo AMDGCNGPUs[39] = {
+constexpr GPUInfo AMDGCNGPUs[43] = {
   // Name         Canonical    Kind        Features
   //              Name
   {{"gfx600"},    {"gfx600"},  GK_GFX600,  FEATURE_FAST_FMA_F32},
   {{"tahiti"},    {"gfx600"},  GK_GFX600,  FEATURE_FAST_FMA_F32},
   {{"gfx601"},    {"gfx601"},  GK_GFX601,  FEATURE_NONE},
-  {{"hainan"},    {"gfx601"},  GK_GFX601,  FEATURE_NONE},
-  {{"oland"},     {"gfx601"},  GK_GFX601,  FEATURE_NONE},
   {{"pitcairn"},  {"gfx601"},  GK_GFX601,  FEATURE_NONE},
   {{"verde"},     {"gfx601"},  GK_GFX601,  FEATURE_NONE},
+  {{"gfx602"},    {"gfx602"},  GK_GFX602,  FEATURE_NONE},
+  {{"hainan"},    {"gfx602"},  GK_GFX602,  FEATURE_NONE},
+  {{"oland"},     {"gfx602"},  GK_GFX602,  FEATURE_NONE},
   {{"gfx700"},    {"gfx700"},  GK_GFX700,  FEATURE_NONE},
   {{"kaveri"},    {"gfx700"},  GK_GFX700,  FEATURE_NONE},
   {{"gfx701"},    {"gfx701"},  GK_GFX701,  FEATURE_FAST_FMA_F32},
@@ -83,6 +84,7 @@ constexpr GPUInfo AMDGCNGPUs[39] = {
   {{"mullins"},   {"gfx703"},  GK_GFX703,  FEATURE_NONE},
   {{"gfx704"},    {"gfx704"},  GK_GFX704,  FEATURE_NONE},
   {{"bonaire"},   {"gfx704"},  GK_GFX704,  FEATURE_NONE},
+  {{"gfx705"},    {"gfx705"},  GK_GFX705,  FEATURE_NONE},
   {{"gfx801"},    {"gfx801"},  GK_GFX801,  
FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
   {{"carrizo"},   {"gfx801"},  GK_GFX801,  
FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
   {{"gfx802"},    {"gfx802"},  GK_GFX802,  
FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
@@ -92,6 +94,8 @@ constexpr GPUInfo AMDGCNGPUs[39] = {
   {{"fiji"},      {"gfx803"},  GK_GFX803,  
FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
   {{"polaris10"}, {"gfx803"},  GK_GFX803,  
FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
   {{"polaris11"}, {"gfx803"},  GK_GFX803,  
FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
+  {{"gfx805"},    {"gfx805"},  GK_GFX805,  
FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
+  {{"tongapro"},  {"gfx805"},  GK_GFX805,  
FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
   {{"gfx810"},    {"gfx810"},  GK_GFX810,  
FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
   {{"stoney"},    {"gfx810"},  GK_GFX810,  
FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
   {{"gfx900"},    {"gfx900"},  GK_GFX900,  
FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
@@ -188,14 +192,17 @@ AMDGPU::IsaVersion AMDGPU::getIsaVersion(StringRef GPU) {
   switch (AK) {
   case GK_GFX600:  return {6, 0, 0};
   case GK_GFX601:  return {6, 0, 1};
+  case GK_GFX602:  return {6, 0, 2};
   case GK_GFX700:  return {7, 0, 0};
   case GK_GFX701:  return {7, 0, 1};
   case GK_GFX702:  return {7, 0, 2};
   case GK_GFX703:  return {7, 0, 3};
   case GK_GFX704:  return {7, 0, 4};
+  case GK_GFX705:  return {7, 0, 5};
   case GK_GFX801:  return {8, 0, 1};
   case GK_GFX802:  return {8, 0, 2};
   case GK_GFX803:  return {8, 0, 3};
+  case GK_GFX805:  return {8, 0, 5};
   case GK_GFX810:  return {8, 1, 0};
   case GK_GFX900:  return {9, 0, 0};
   case GK_GFX902:  return {9, 0, 2};

diff  --git a/llvm/lib/Target/AMDGPU/AMDGPU.td 
b/llvm/lib/Target/AMDGPU/AMDGPU.td
index 1cd19a1d6484..57a102a1303f 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.td
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.td
@@ -761,6 +761,12 @@ def FeatureISAVersion6_0_1 : FeatureSet<
    FeatureDoesNotSupportXNACK,
    FeatureCodeObjectV3]>;
 
+def FeatureISAVersion6_0_2 : FeatureSet<
+  [FeatureSouthernIslands,
+   FeatureLDSBankCount32,
+   FeatureDoesNotSupportXNACK,
+   FeatureCodeObjectV3]>;
+
 def FeatureISAVersion7_0_0 : FeatureSet<
   [FeatureSeaIslands,
    FeatureLDSBankCount32,
@@ -794,6 +800,12 @@ def FeatureISAVersion7_0_4 : FeatureSet<
    FeatureDoesNotSupportXNACK,
    FeatureCodeObjectV3]>;
 
+def FeatureISAVersion7_0_5 : FeatureSet<
+  [FeatureSeaIslands,
+   FeatureLDSBankCount16,
+   FeatureDoesNotSupportXNACK,
+   FeatureCodeObjectV3]>;
+
 def FeatureISAVersion8_0_1 : FeatureSet<
   [FeatureVolcanicIslands,
    FeatureFastFMAF32,
@@ -818,6 +830,14 @@ def FeatureISAVersion8_0_3 : FeatureSet<
    FeatureDoesNotSupportXNACK,
    FeatureCodeObjectV3]>;
 
+def FeatureISAVersion8_0_5 : FeatureSet<
+  [FeatureVolcanicIslands,
+   FeatureLDSBankCount32,
+   FeatureSGPRInitBug,
+   FeatureUnpackedD16VMem,
+   FeatureDoesNotSupportXNACK,
+   FeatureCodeObjectV3]>;
+
 def FeatureISAVersion8_1_0 : FeatureSet<
   [FeatureVolcanicIslands,
    FeatureLDSBankCount16,

diff  --git a/llvm/lib/Target/AMDGPU/GCNProcessors.td 
b/llvm/lib/Target/AMDGPU/GCNProcessors.td
index 8b0132a5596f..accb550db318 100644
--- a/llvm/lib/Target/AMDGPU/GCNProcessors.td
+++ b/llvm/lib/Target/AMDGPU/GCNProcessors.td
@@ -32,20 +32,24 @@ def : ProcessorModel<"gfx601", SIQuarterSpeedModel,
   FeatureISAVersion6_0_1.Features
 >;
 
-def : ProcessorModel<"hainan", SIQuarterSpeedModel,
+def : ProcessorModel<"pitcairn", SIQuarterSpeedModel,
   FeatureISAVersion6_0_1.Features
 >;
 
-def : ProcessorModel<"oland", SIQuarterSpeedModel,
+def : ProcessorModel<"verde", SIQuarterSpeedModel,
   FeatureISAVersion6_0_1.Features
 >;
 
-def : ProcessorModel<"pitcairn", SIQuarterSpeedModel,
-  FeatureISAVersion6_0_1.Features
+def : ProcessorModel<"gfx602", SIQuarterSpeedModel,
+  FeatureISAVersion6_0_2.Features
 >;
 
-def : ProcessorModel<"verde", SIQuarterSpeedModel,
-  FeatureISAVersion6_0_1.Features
+def : ProcessorModel<"hainan", SIQuarterSpeedModel,
+  FeatureISAVersion6_0_2.Features
+>;
+
+def : ProcessorModel<"oland", SIQuarterSpeedModel,
+  FeatureISAVersion6_0_2.Features
 >;
 
 //===------------------------------------------------------------===//
@@ -92,6 +96,10 @@ def : ProcessorModel<"bonaire", SIQuarterSpeedModel,
   FeatureISAVersion7_0_4.Features
 >;
 
+def : ProcessorModel<"gfx705", SIQuarterSpeedModel,
+  FeatureISAVersion7_0_5.Features
+>;
+
 //===------------------------------------------------------------===//
 // GCN GFX8 (Volcanic Islands (VI)).
 //===------------------------------------------------------------===//
@@ -132,6 +140,14 @@ def : ProcessorModel<"polaris11", SIQuarterSpeedModel,
   FeatureISAVersion8_0_3.Features
 >;
 
+def : ProcessorModel<"gfx805", SIQuarterSpeedModel,
+  FeatureISAVersion8_0_5.Features
+>;
+
+def : ProcessorModel<"tongapro", SIQuarterSpeedModel,
+  FeatureISAVersion8_0_5.Features
+>;
+
 def : ProcessorModel<"gfx810", SIQuarterSpeedModel,
   FeatureISAVersion8_1_0.Features
 >;

diff  --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp 
b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
index 9d662eca45a6..19ec03609246 100644
--- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
+++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
@@ -79,14 +79,17 @@ StringRef 
AMDGPUTargetStreamer::getArchNameFromElfMach(unsigned ElfMach) {
   case ELF::EF_AMDGPU_MACH_R600_TURKS:     AK = GK_TURKS;   break;
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX600:  AK = GK_GFX600;  break;
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX601:  AK = GK_GFX601;  break;
+  case ELF::EF_AMDGPU_MACH_AMDGCN_GFX602:  AK = GK_GFX602;  break;
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX700:  AK = GK_GFX700;  break;
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX701:  AK = GK_GFX701;  break;
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX702:  AK = GK_GFX702;  break;
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX703:  AK = GK_GFX703;  break;
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX704:  AK = GK_GFX704;  break;
+  case ELF::EF_AMDGPU_MACH_AMDGCN_GFX705:  AK = GK_GFX705;  break;
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX801:  AK = GK_GFX801;  break;
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX802:  AK = GK_GFX802;  break;
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX803:  AK = GK_GFX803;  break;
+  case ELF::EF_AMDGPU_MACH_AMDGCN_GFX805:  AK = GK_GFX805;  break;
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX810:  AK = GK_GFX810;  break;
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX900:  AK = GK_GFX900;  break;
   case ELF::EF_AMDGPU_MACH_AMDGCN_GFX902:  AK = GK_GFX902;  break;
@@ -132,14 +135,17 @@ unsigned AMDGPUTargetStreamer::getElfMach(StringRef GPU) {
   case GK_TURKS:   return ELF::EF_AMDGPU_MACH_R600_TURKS;
   case GK_GFX600:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX600;
   case GK_GFX601:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX601;
+  case GK_GFX602:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX602;
   case GK_GFX700:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX700;
   case GK_GFX701:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX701;
   case GK_GFX702:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX702;
   case GK_GFX703:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX703;
   case GK_GFX704:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX704;
+  case GK_GFX705:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX705;
   case GK_GFX801:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX801;
   case GK_GFX802:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX802;
   case GK_GFX803:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX803;
+  case GK_GFX805:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX805;
   case GK_GFX810:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX810;
   case GK_GFX900:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX900;
   case GK_GFX902:  return ELF::EF_AMDGPU_MACH_AMDGCN_GFX902;

diff  --git a/llvm/test/CodeGen/AMDGPU/directive-amdgcn-target.ll 
b/llvm/test/CodeGen/AMDGPU/directive-amdgcn-target.ll
index b27e42ca1ace..06391e079718 100644
--- a/llvm/test/CodeGen/AMDGPU/directive-amdgcn-target.ll
+++ b/llvm/test/CodeGen/AMDGPU/directive-amdgcn-target.ll
@@ -1,10 +1,11 @@
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx600 -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX600 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=tahiti -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX600 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx601 -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX601 %s
-; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=hainan -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX601 %s
-; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=oland -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX601 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=pitcairn -mattr=+code-object-v3 < 
%s | FileCheck --check-prefixes=GFX601 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=verde -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX601 %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx602 -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX602 %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=hainan -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX602 %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=oland -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX602 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX700 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=kaveri -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX700 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx701 -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX701 %s
@@ -15,6 +16,7 @@
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=mullins -mattr=+code-object-v3 < 
%s | FileCheck --check-prefixes=GFX703 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx704 -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX704 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=bonaire -mattr=+code-object-v3 < 
%s | FileCheck --check-prefixes=GFX704 %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx705 -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX705 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx801 -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX801 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=carrizo -mattr=+code-object-v3 < 
%s | FileCheck --check-prefixes=GFX801 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx802 -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX802 %s
@@ -24,6 +26,8 @@
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=fiji -mattr=+code-object-v3 < %s | 
FileCheck --check-prefixes=GFX803 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=polaris10 -mattr=+code-object-v3 < 
%s | FileCheck --check-prefixes=GFX803 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=polaris11 -mattr=+code-object-v3 < 
%s | FileCheck --check-prefixes=GFX803 %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx805 -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX805 %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=tongapro -mattr=+code-object-v3 < 
%s | FileCheck --check-prefixes=GFX805 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx810 -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX810 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=stoney -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX810 %s
 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -mattr=+code-object-v3 < %s 
| FileCheck --check-prefixes=GFX900 %s
@@ -42,14 +46,17 @@
 
 ; GFX600: .amdgcn_target "amdgcn-amd-amdhsa--gfx600"
 ; GFX601: .amdgcn_target "amdgcn-amd-amdhsa--gfx601"
+; GFX602: .amdgcn_target "amdgcn-amd-amdhsa--gfx602"
 ; GFX700: .amdgcn_target "amdgcn-amd-amdhsa--gfx700"
 ; GFX701: .amdgcn_target "amdgcn-amd-amdhsa--gfx701"
 ; GFX702: .amdgcn_target "amdgcn-amd-amdhsa--gfx702"
 ; GFX703: .amdgcn_target "amdgcn-amd-amdhsa--gfx703"
 ; GFX704: .amdgcn_target "amdgcn-amd-amdhsa--gfx704"
+; GFX705: .amdgcn_target "amdgcn-amd-amdhsa--gfx705"
 ; GFX801: .amdgcn_target "amdgcn-amd-amdhsa--gfx801+xnack"
 ; GFX802: .amdgcn_target "amdgcn-amd-amdhsa--gfx802"
 ; GFX803: .amdgcn_target "amdgcn-amd-amdhsa--gfx803"
+; GFX805: .amdgcn_target "amdgcn-amd-amdhsa--gfx805"
 ; GFX810: .amdgcn_target "amdgcn-amd-amdhsa--gfx810+xnack"
 ; GFX900: .amdgcn_target "amdgcn-amd-amdhsa--gfx900"
 ; GFX902: .amdgcn_target "amdgcn-amd-amdhsa--gfx902+xnack"

diff  --git a/llvm/test/CodeGen/AMDGPU/elf-header-flags-mach.ll 
b/llvm/test/CodeGen/AMDGPU/elf-header-flags-mach.ll
index 15c8ca8a2796..9fddf1c32ec3 100644
--- a/llvm/test/CodeGen/AMDGPU/elf-header-flags-mach.ll
+++ b/llvm/test/CodeGen/AMDGPU/elf-header-flags-mach.ll
@@ -17,10 +17,11 @@
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx600 < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX600 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=tahiti < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX600 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx601 < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX601 %s
-; RUN: llc -filetype=obj -march=amdgcn -mcpu=hainan < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX601 %s
-; RUN: llc -filetype=obj -march=amdgcn -mcpu=oland < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX601 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=pitcairn < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX601 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=verde < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX601 %s
+; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx602 < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX602 %s
+; RUN: llc -filetype=obj -march=amdgcn -mcpu=hainan < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX602 %s
+; RUN: llc -filetype=obj -march=amdgcn -mcpu=oland < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX602 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx700 < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX700 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=kaveri < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX700 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx701 < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX701 %s
@@ -31,6 +32,7 @@
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=mullins < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX703 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx704 < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX704 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=bonaire < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX704 %s
+; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx705 < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX705 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx801 < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX801 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=carrizo < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX801 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx802 < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX802 %s
@@ -40,6 +42,8 @@
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=fiji < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX803 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=polaris10 < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX803 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=polaris11 < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX803 %s
+; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx805 < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX805 %s
+; RUN: llc -filetype=obj -march=amdgcn -mcpu=tongapro < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX805 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx810 < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX810 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=stoney < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX810 %s
 ; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx900 < %s | llvm-readobj 
-file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX900 %s
@@ -76,15 +80,18 @@
 ; TURKS:         EF_AMDGPU_MACH_R600_TURKS    (0x10)
 ; GFX600:        EF_AMDGPU_MACH_AMDGCN_GFX600 (0x20)
 ; GFX601:        EF_AMDGPU_MACH_AMDGCN_GFX601 (0x21)
+; GFX602:        EF_AMDGPU_MACH_AMDGCN_GFX602 (0x3A)
 ; GFX700:        EF_AMDGPU_MACH_AMDGCN_GFX700 (0x22)
 ; GFX701:        EF_AMDGPU_MACH_AMDGCN_GFX701 (0x23)
 ; GFX702:        EF_AMDGPU_MACH_AMDGCN_GFX702 (0x24)
 ; GFX703:        EF_AMDGPU_MACH_AMDGCN_GFX703 (0x25)
 ; GFX704:        EF_AMDGPU_MACH_AMDGCN_GFX704 (0x26)
+; GFX705:        EF_AMDGPU_MACH_AMDGCN_GFX705 (0x3B)
 ; GFX801:        EF_AMDGPU_MACH_AMDGCN_GFX801 (0x28)
 ; GFX801-NEXT:   EF_AMDGPU_XNACK              (0x100)
 ; GFX802:        EF_AMDGPU_MACH_AMDGCN_GFX802 (0x29)
 ; GFX803:        EF_AMDGPU_MACH_AMDGCN_GFX803 (0x2A)
+; GFX805:        EF_AMDGPU_MACH_AMDGCN_GFX805 (0x3C)
 ; GFX810:        EF_AMDGPU_MACH_AMDGCN_GFX810 (0x2B)
 ; GFX810-NEXT:   EF_AMDGPU_XNACK              (0x100)
 ; GFX900:        EF_AMDGPU_MACH_AMDGCN_GFX900 (0x2C)

diff  --git a/llvm/test/Object/AMDGPU/elf-header-flags-mach.yaml 
b/llvm/test/Object/AMDGPU/elf-header-flags-mach.yaml
index 7d2fd3b1fd06..78a845c5a941 100644
--- a/llvm/test/Object/AMDGPU/elf-header-flags-mach.yaml
+++ b/llvm/test/Object/AMDGPU/elf-header-flags-mach.yaml
@@ -100,6 +100,15 @@
 # RUN: yaml2obj --docnum=34 %s -o %t.o.34
 # RUN: llvm-readobj -s -file-headers %t.o.34 | FileCheck 
--check-prefixes=ELF-ALL,ELF-GFX1010 %s
 # RUN: obj2yaml %t.o.34 | FileCheck --check-prefixes=YAML-GFX1010 %s
+# RUN: yaml2obj --docnum=35 %s -o %t.o.35
+# RUN: llvm-readobj -S --file-headers %t.o.35 | FileCheck 
--check-prefixes=ELF-ALL,ELF-GFX602 %s
+# RUN: obj2yaml %t.o.35 | FileCheck --check-prefixes=YAML-GFX602 %s
+# RUN: yaml2obj --docnum=36 %s -o %t.o.36
+# RUN: llvm-readobj -S --file-headers %t.o.36 | FileCheck 
--check-prefixes=ELF-ALL,ELF-GFX705 %s
+# RUN: obj2yaml %t.o.36 | FileCheck --check-prefixes=YAML-GFX705 %s
+# RUN: yaml2obj --docnum=37 %s -o %t.o.37
+# RUN: llvm-readobj -S --file-headers %t.o.37 | FileCheck 
--check-prefixes=ELF-ALL,ELF-GFX805 %s
+# RUN: obj2yaml %t.o.37 | FileCheck --check-prefixes=YAML-GFX805 %s
 
 # ELF-ALL:     Flags [
 # ELF-R600:      EF_AMDGPU_MACH_R600_R600     (0x1)
@@ -136,6 +145,9 @@
 # ELF-GFX908:    EF_AMDGPU_MACH_AMDGCN_GFX908 (0x30)
 # ELF-GFX909:    EF_AMDGPU_MACH_AMDGCN_GFX909 (0x31)
 # ELF-GFX1010:   EF_AMDGPU_MACH_AMDGCN_GFX1010 (0x33)
+# ELF-GFX602:    EF_AMDGPU_MACH_AMDGCN_GFX602 (0x3A)
+# ELF-GFX705:    EF_AMDGPU_MACH_AMDGCN_GFX705 (0x3B)
+# ELF-GFX805:    EF_AMDGPU_MACH_AMDGCN_GFX805 (0x3C)
 # ELF-ALL:     ]
 
 # YAML-R600:    Flags: [ EF_AMDGPU_MACH_R600_R600 ]
@@ -156,14 +168,17 @@
 # YAML-TURKS:   Flags: [ EF_AMDGPU_MACH_R600_TURKS ]
 # YAML-GFX600:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX600 ]
 # YAML-GFX601:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX601 ]
+# YAML-GFX602:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX602 ]
 # YAML-GFX700:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX700 ]
 # YAML-GFX701:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX701 ]
 # YAML-GFX702:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX702 ]
 # YAML-GFX703:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX703 ]
 # YAML-GFX704:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX704 ]
+# YAML-GFX705:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX705 ]
 # YAML-GFX801:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX801 ]
 # YAML-GFX802:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX802 ]
 # YAML-GFX803:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX803 ]
+# YAML-GFX805:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX805 ]
 # YAML-GFX810:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX810 ]
 # YAML-GFX900:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX900 ]
 # YAML-GFX902:  Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX902 ]
@@ -547,3 +562,36 @@ FileHeader:
   Flags:   [ EF_AMDGPU_MACH_AMDGCN_GFX1010 ]
 ...
 
+# Doc35
+--- !ELF
+FileHeader:
+  Class:   ELFCLASS64
+  Data:    ELFDATA2LSB
+  OSABI:   ELFOSABI_NONE
+  Type:    ET_REL
+  Machine: EM_AMDGPU
+  Flags:   [ EF_AMDGPU_MACH_AMDGCN_GFX602 ]
+...
+
+# Doc36
+--- !ELF
+FileHeader:
+  Class:   ELFCLASS64
+  Data:    ELFDATA2LSB
+  OSABI:   ELFOSABI_NONE
+  Type:    ET_REL
+  Machine: EM_AMDGPU
+  Flags:   [ EF_AMDGPU_MACH_AMDGCN_GFX705 ]
+...
+
+# Doc37
+--- !ELF
+FileHeader:
+  Class:   ELFCLASS64
+  Data:    ELFDATA2LSB
+  OSABI:   ELFOSABI_NONE
+  Type:    ET_REL
+  Machine: EM_AMDGPU
+  Flags:   [ EF_AMDGPU_MACH_AMDGCN_GFX805 ]
+...
+

diff  --git a/llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-headers.test 
b/llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-headers.test
index f4c02b051ac0..96b75c0fc7cf 100644
--- a/llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-headers.test
+++ b/llvm/test/tools/llvm-readobj/ELF/amdgpu-elf-headers.test
@@ -4,6 +4,9 @@
 # RUN: yaml2obj %s -o %t -DCPU=GFX601
 # RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t 
-DCPU=GFX601 -DFLAGS=0x21
 
+# RUN: yaml2obj %s -o %t -DCPU=GFX602
+# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t 
-DCPU=GFX602 -DFLAGS=0x3A
+
 # RUN: yaml2obj %s -o %t -DCPU=GFX700
 # RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t 
-DCPU=GFX700 -DFLAGS=0x22
 
@@ -19,6 +22,9 @@
 # RUN: yaml2obj %s -o %t -DCPU=GFX704
 # RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t 
-DCPU=GFX704 -DFLAGS=0x26
 
+# RUN: yaml2obj %s -o %t -DCPU=GFX705
+# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t 
-DCPU=GFX705 -DFLAGS=0x3B
+
 # RUN: yaml2obj %s -o %t -DCPU=GFX801
 # RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t 
-DCPU=GFX801 -DFLAGS=0x28
 
@@ -28,6 +34,9 @@
 # RUN: yaml2obj %s -o %t -DCPU=GFX803
 # RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t 
-DCPU=GFX803 -DFLAGS=0x2A
 
+# RUN: yaml2obj %s -o %t -DCPU=GFX805
+# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t 
-DCPU=GFX805 -DFLAGS=0x3C
+
 # RUN: yaml2obj %s -o %t -DCPU=GFX810
 # RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t 
-DCPU=GFX810 -DFLAGS=0x2B
 

diff  --git a/llvm/tools/llvm-readobj/ELFDumper.cpp 
b/llvm/tools/llvm-readobj/ELFDumper.cpp
index b3a38b706bdc..88437000a88f 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -1749,14 +1749,17 @@ static const EnumEntry<unsigned> ElfHeaderAMDGPUFlags[] 
= {
   LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_TURKS),
   LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX600),
   LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX601),
+  LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX602),
   LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX700),
   LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX701),
   LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX702),
   LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX703),
   LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX704),
+  LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX705),
   LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX801),
   LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX802),
   LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX803),
+  LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX805),
   LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX810),
   LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX900),
   LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX902),


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to