[clang] 40ad476 - [clang][AMDGPU] rename sram-ecc as sramecc
Yaxun Liu via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 7 15:06:15 PST 2020
Author: Yaxun (Sam) Liu
Date: 2020-12-07T18:05:47-05:00
New Revision: 40ad476a32445ec98666adcf24d2b33fd887ccc6
URL: https://github.com/llvm/llvm-project/commit/40ad476a32445ec98666adcf24d2b33fd887ccc6
DIFF: https://github.com/llvm/llvm-project/commit/40ad476a32445ec98666adcf24d2b33fd887ccc6.diff
LOG: [clang][AMDGPU] rename sram-ecc as sramecc
As backend renamed sram-ecc to sramecc, this patch makes
corresponding change in clang.
Differential Revision: https://reviews.llvm.org/D86217
Added:
Modified:
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/include/clang/Basic/TargetID.h
clang/include/clang/Driver/Options.td
clang/lib/Basic/TargetID.cpp
clang/lib/Basic/Targets/AMDGPU.h
clang/test/Driver/amdgpu-features.c
clang/test/Driver/hip-invalid-target-id.hip
clang/test/Driver/hip-target-id.hip
clang/test/Driver/hip-toolchain-features.hip
clang/test/Driver/invalid-target-id.cl
clang/test/Driver/target-id-macros.cl
clang/test/Driver/target-id-macros.hip
clang/test/Driver/target-id.cl
llvm/include/llvm/Support/TargetParser.h
llvm/lib/Support/TargetParser.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td
index d6a2609e60f9..8fd7a805589d 100644
--- a/clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -79,7 +79,7 @@ def err_drv_cuda_host_arch : Error<"unsupported architecture '%0' for host compi
def err_drv_mix_cuda_hip : Error<"Mixed Cuda and HIP compilation is not supported.">;
def err_drv_bad_target_id : Error<"Invalid target ID: %0 (A target ID is a processor name "
"followed by an optional list of predefined features post-fixed by a plus or minus sign deliminated "
- "by colon, e.g. 'gfx908:sram-ecc+:xnack-')">;
+ "by colon, e.g. 'gfx908:sramecc+:xnack-')">;
def err_drv_bad_offload_arch_combo : Error<"Invalid offload arch combinations: %0 and %1 (For a specific "
"processor, a feature should either exist in all offload archs, or not exist in any offload archs)">;
def err_drv_invalid_thread_model_for_target : Error<
diff --git a/clang/include/clang/Basic/TargetID.h b/clang/include/clang/Basic/TargetID.h
index 95fd61d22eb1..1a9785574d06 100644
--- a/clang/include/clang/Basic/TargetID.h
+++ b/clang/include/clang/Basic/TargetID.h
@@ -19,7 +19,7 @@ namespace clang {
/// Get all feature strings that can be used in target ID for \p Processor.
/// Target ID is a processor name with optional feature strings
/// postfixed by a plus or minus sign delimited by colons, e.g.
-/// gfx908:xnack+:sram-ecc-. Each processor have a limited
+/// gfx908:xnack+:sramecc-. Each processor have a limited
/// number of predefined features when showing up in a target ID.
const llvm::SmallVector<llvm::StringRef, 4>
getAllPossibleTargetIDFeatures(const llvm::Triple &T,
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 6480d6e80293..347349031669 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -666,7 +666,7 @@ def no_cuda_include_ptx_EQ : Joined<["--"], "no-cuda-include-ptx=">, Flags<[NoXa
def offload_arch_EQ : Joined<["--"], "offload-arch=">, Flags<[NoXarchOption]>,
HelpText<"CUDA offloading device architecture (e.g. sm_35), or HIP offloading target ID in the form of a "
"device architecture followed by target ID features delimited by a colon. Each target ID feature "
- "is a pre-defined string followed by a plus or minus sign (e.g. gfx908:xnack+:sram-ecc-). May be "
+ "is a pre-defined string followed by a plus or minus sign (e.g. gfx908:xnack+:sramecc-). May be "
"specified more than once.">;
def cuda_gpu_arch_EQ : Joined<["--"], "cuda-gpu-arch=">, Flags<[NoXarchOption]>,
Alias<offload_arch_EQ>;
@@ -2568,9 +2568,9 @@ def mcumode : Flag<["-"], "mcumode">, Group<m_amdgpu_Features_Group>,
HelpText<"Specify CU (-mcumode) or WGP (-mno-cumode) wavefront execution mode (AMDGPU only)">;
def mno_cumode : Flag<["-"], "mno-cumode">, Group<m_amdgpu_Features_Group>;
-def msram_ecc : Flag<["-"], "msram-ecc">, Group<m_amdgpu_Features_Group>,
+def msramecc : Flag<["-"], "msramecc">, Group<m_amdgpu_Features_Group>,
HelpText<"Specify SRAM ECC mode (AMDGPU only)">;
-def mno_sram_ecc : Flag<["-"], "mno-sram-ecc">, Group<m_amdgpu_Features_Group>;
+def mno_sramecc : Flag<["-"], "mno-sramecc">, Group<m_amdgpu_Features_Group>;
def mwavefrontsize64 : Flag<["-"], "mwavefrontsize64">, Group<m_Group>,
HelpText<"Specify wavefront size 64 mode (AMDGPU only)">;
diff --git a/clang/lib/Basic/TargetID.cpp b/clang/lib/Basic/TargetID.cpp
index 3bb895f28832..59d416f0e015 100644
--- a/clang/lib/Basic/TargetID.cpp
+++ b/clang/lib/Basic/TargetID.cpp
@@ -26,8 +26,8 @@ getAllPossibleAMDGPUTargetIDFeatures(const llvm::Triple &T,
return Ret;
auto Features = T.isAMDGCN() ? llvm::AMDGPU::getArchAttrAMDGCN(ProcKind)
: llvm::AMDGPU::getArchAttrR600(ProcKind);
- if (Features & llvm::AMDGPU::FEATURE_SRAM_ECC)
- Ret.push_back("sram-ecc");
+ if (Features & llvm::AMDGPU::FEATURE_SRAMECC)
+ Ret.push_back("sramecc");
if (Features & llvm::AMDGPU::FEATURE_XNACK)
Ret.push_back("xnack");
return Ret;
@@ -61,7 +61,7 @@ llvm::StringRef getProcessorFromTargetID(const llvm::Triple &T,
//
// A target ID is a processor name followed by a list of target features
// delimited by colon. Each target feature is a string post-fixed by a plus
-// or minus sign, e.g. gfx908:sram-ecc+:xnack-.
+// or minus sign, e.g. gfx908:sramecc+:xnack-.
static llvm::Optional<llvm::StringRef>
parseTargetIDWithFormatCheckingOnly(llvm::StringRef TargetID,
llvm::StringMap<bool> *FeatureMap) {
diff --git a/clang/lib/Basic/Targets/AMDGPU.h b/clang/lib/Basic/Targets/AMDGPU.h
index 2158a8d253d6..8b3f30ed70e9 100644
--- a/clang/lib/Basic/Targets/AMDGPU.h
+++ b/clang/lib/Basic/Targets/AMDGPU.h
@@ -44,7 +44,7 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo {
unsigned WavefrontSize;
/// Target ID is device name followed by optional feature name postfixed
- /// by plus or minus sign delimitted by colon, e.g. gfx908:xnack+:sram-ecc-.
+ /// by plus or minus sign delimitted by colon, e.g. gfx908:xnack+:sramecc-.
/// If the target ID contains feature+, map it to true.
/// If the target ID contains feature-, map it to false.
/// If the target ID does not contain a feature (default), do not map it.
diff --git a/clang/test/Driver/amdgpu-features.c b/clang/test/Driver/amdgpu-features.c
index a685870c764f..aa71a70d4e0b 100644
--- a/clang/test/Driver/amdgpu-features.c
+++ b/clang/test/Driver/amdgpu-features.c
@@ -16,11 +16,11 @@
// RUN: %clang -### -target amdgcn-amdpal -mcpu=gfx900:xnack- %s 2>&1 | FileCheck --check-prefix=NO-XNACK %s
// NO-XNACK: "-target-feature" "-xnack"
-// RUN: %clang -### -target amdgcn-mesa3d -mcpu=gfx908:sram-ecc+ %s 2>&1 | FileCheck --check-prefix=SRAM-ECC %s
-// SRAM-ECC: "-target-feature" "+sram-ecc"
+// RUN: %clang -### -target amdgcn-mesa3d -mcpu=gfx908:sramecc+ %s 2>&1 | FileCheck --check-prefix=SRAM-ECC %s
+// SRAM-ECC: "-target-feature" "+sramecc"
-// RUN: %clang -### -target amdgcn-amdhsa -mcpu=gfx908:sram-ecc- %s 2>&1 | FileCheck --check-prefix=NO-SRAM-ECC %s
-// NO-SRAM-ECC: "-target-feature" "-sram-ecc"
+// RUN: %clang -### -target amdgcn-amdhsa -mcpu=gfx908:sramecc- %s 2>&1 | FileCheck --check-prefix=NO-SRAM-ECC %s
+// NO-SRAM-ECC: "-target-feature" "-sramecc"
// RUN: %clang -### -target amdgcn-amdpal -mcpu=gfx1010 -mwavefrontsize64 %s 2>&1 | FileCheck --check-prefix=WAVE64 %s
// RUN: %clang -### -target amdgcn-amdpal -mcpu=gfx1010 -mno-wavefrontsize64 -mwavefrontsize64 %s 2>&1 | FileCheck --check-prefix=WAVE64 %s
diff --git a/clang/test/Driver/hip-invalid-target-id.hip b/clang/test/Driver/hip-invalid-target-id.hip
index cbd6f59b0854..7514998a4bb7 100644
--- a/clang/test/Driver/hip-invalid-target-id.hip
+++ b/clang/test/Driver/hip-invalid-target-id.hip
@@ -21,7 +21,7 @@
// RUN: not %clang -### -target x86_64-linux-gnu \
// RUN: -x hip --offload-arch=gfx908 \
// RUN: --offload-arch=gfx908:unknown+ \
-// RUN: --offload-arch=gfx908+sram-ecc+unknown \
+// RUN: --offload-arch=gfx908+sramecc+unknown \
// RUN: --offload-arch=gfx900+xnack \
// RUN: --rocm-path=%S/Inputs/rocm \
// RUN: %s 2>&1 | FileCheck -check-prefix=UNK %s
@@ -30,20 +30,20 @@
// RUN: not %clang -### -target x86_64-linux-gnu \
// RUN: -x hip --offload-arch=gfx908 \
-// RUN: --offload-arch=gfx908:sram-ecc+:unknown+ \
+// RUN: --offload-arch=gfx908:sramecc+:unknown+ \
// RUN: --offload-arch=gfx900+xnack \
// RUN: --rocm-path=%S/Inputs/rocm \
// RUN: %s 2>&1 | FileCheck -check-prefix=MIXED %s
-// MIXED: error: Invalid target ID: gfx908:sram-ecc+:unknown+
+// MIXED: error: Invalid target ID: gfx908:sramecc+:unknown+
// RUN: not %clang -### -target x86_64-linux-gnu \
// RUN: -x hip --offload-arch=gfx908 \
-// RUN: --offload-arch=gfx900:sram-ecc+ \
+// RUN: --offload-arch=gfx900:sramecc+ \
// RUN: --rocm-path=%S/Inputs/rocm \
// RUN: %s 2>&1 | FileCheck -check-prefix=UNSUP %s
-// UNSUP: error: Invalid target ID: gfx900:sram-ecc+
+// UNSUP: error: Invalid target ID: gfx900:sramecc+
/ RUN: not %clang -### -target x86_64-linux-gnu \
// RUN: -x hip --offload-arch=gfx908 \
diff --git a/clang/test/Driver/hip-target-id.hip b/clang/test/Driver/hip-target-id.hip
index c4a5c5c6737e..073f01ca812a 100644
--- a/clang/test/Driver/hip-target-id.hip
+++ b/clang/test/Driver/hip-target-id.hip
@@ -4,50 +4,50 @@
// RUN: %clang -### -target x86_64-linux-gnu \
// RUN: -x hip \
-// RUN: --offload-arch=gfx908:xnack+:sram-ecc+ \
-// RUN: --offload-arch=gfx908:xnack+:sram-ecc- \
+// RUN: --offload-arch=gfx908:xnack+:sramecc+ \
+// RUN: --offload-arch=gfx908:xnack+:sramecc- \
// RUN: --rocm-path=%S/Inputs/rocm \
// RUN: %s 2>&1 | FileCheck %s
// RUN: %clang -### -target x86_64-linux-gnu \
// RUN: -x hip \
-// RUN: --offload-arch=gfx908:xnack+:sram-ecc+ \
-// RUN: --offload-arch=gfx908:xnack+:sram-ecc- \
+// RUN: --offload-arch=gfx908:xnack+:sramecc+ \
+// RUN: --offload-arch=gfx908:xnack+:sramecc- \
// RUN: --rocm-path=%S/Inputs/rocm \
// RUN: -save-temps \
// RUN: %s 2>&1 | FileCheck --check-prefixes=CHECK,TMP %s
// RUN: %clang -### -target x86_64-linux-gnu \
// RUN: -x hip \
-// RUN: --offload-arch=gfx908:xnack+:sram-ecc+ \
-// RUN: --offload-arch=gfx908:xnack+:sram-ecc- \
+// RUN: --offload-arch=gfx908:xnack+:sramecc+ \
+// RUN: --offload-arch=gfx908:xnack+:sramecc- \
// RUN: --rocm-path=%S/Inputs/rocm \
// RUN: -fgpu-rdc \
// RUN: %s 2>&1 | FileCheck --check-prefixes=CHECK %s
// CHECK: [[CLANG:"[^"]*clang[^"]*"]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
// CHECK-SAME: "-target-cpu" "gfx908"
-// CHECK-SAME: "-target-feature" "+sram-ecc"
+// CHECK-SAME: "-target-feature" "+sramecc"
// CHECK-SAME: "-target-feature" "+xnack"
// TMP: [[CLANG:"[^"]*clang[^"]*"]] "-cc1as" "-triple" "amdgcn-amd-amdhsa"
// TMP-SAME: "-target-cpu" "gfx908"
-// TMP-SAME: "-target-feature" "+sram-ecc"
+// TMP-SAME: "-target-feature" "+sramecc"
// TMP-SAME: "-target-feature" "+xnack"
// CHECK: [[LLD:"[^"]*lld[^"]*"]] {{.*}} "-plugin-opt=mcpu=gfx908"
-// CHECK-SAME: "-plugin-opt=-mattr=+sram-ecc,+xnack"
+// CHECK-SAME: "-plugin-opt=-mattr=+sramecc,+xnack"
// CHECK: [[CLANG]] "-cc1" "-triple" "amdgcn-amd-amdhsa"
// CHECK-SAME: "-target-cpu" "gfx908"
-// CHECK-SAME: "-target-feature" "-sram-ecc"
+// CHECK-SAME: "-target-feature" "-sramecc"
// CHECK-SAME: "-target-feature" "+xnack"
// CHECK: [[LLD]] {{.*}} "-plugin-opt=mcpu=gfx908"
-// CHECK-SAME: "-plugin-opt=-mattr=-sram-ecc,+xnack"
+// CHECK-SAME: "-plugin-opt=-mattr=-sramecc,+xnack"
// CHECK: {{"[^"]*clang-offload-bundler[^"]*"}}
-// CHECK-SAME: "-targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa-gfx908:sram-ecc+:xnack+,hip-amdgcn-amd-amdhsa-gfx908:sram-ecc-:xnack+"
+// CHECK-SAME: "-targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa-gfx908:sramecc+:xnack+,hip-amdgcn-amd-amdhsa-gfx908:sramecc-:xnack+"
// Check canonicalization and repeating of target ID.
@@ -64,9 +64,9 @@
// RUN: -x hip \
// RUN: --offload-arch=gfx900:xnack- \
// RUN: --offload-arch=gfx900:xnack+ \
-// RUN: --offload-arch=gfx908:sram-ecc+ \
-// RUN: --offload-arch=gfx908:sram-ecc- \
+// RUN: --offload-arch=gfx908:sramecc+ \
+// RUN: --offload-arch=gfx908:sramecc- \
// RUN: --offload-arch=gfx906 \
// RUN: --rocm-path=%S/Inputs/rocm \
// RUN: %s 2>&1 | FileCheck -check-prefix=MULTI %s
-// MULTI: "-targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa-gfx900:xnack+,hip-amdgcn-amd-amdhsa-gfx900:xnack-,hip-amdgcn-amd-amdhsa-gfx906,hip-amdgcn-amd-amdhsa-gfx908:sram-ecc+,hip-amdgcn-amd-amdhsa-gfx908:sram-ecc-"
+// MULTI: "-targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa-gfx900:xnack+,hip-amdgcn-amd-amdhsa-gfx900:xnack-,hip-amdgcn-amd-amdhsa-gfx906,hip-amdgcn-amd-amdhsa-gfx908:sramecc+,hip-amdgcn-amd-amdhsa-gfx908:sramecc-"
diff --git a/clang/test/Driver/hip-toolchain-features.hip b/clang/test/Driver/hip-toolchain-features.hip
index d6617ef28f1c..13da70fe4fc0 100644
--- a/clang/test/Driver/hip-toolchain-features.hip
+++ b/clang/test/Driver/hip-toolchain-features.hip
@@ -15,16 +15,16 @@
// NOXNACK: {{.*}}lld{{.*}} "-plugin-opt=-mattr=-xnack"
// RUN: %clang -### -target x86_64-linux-gnu -fgpu-rdc -nogpulib \
-// RUN: --cuda-gpu-arch=gfx908:sram-ecc+ %s \
+// RUN: --cuda-gpu-arch=gfx908:sramecc+ %s \
// RUN: 2>&1 | FileCheck %s -check-prefix=SRAM
// RUN: %clang -### -target x86_64-linux-gnu -fgpu-rdc -nogpulib \
-// RUN: --cuda-gpu-arch=gfx908:sram-ecc- %s \
+// RUN: --cuda-gpu-arch=gfx908:sramecc- %s \
// RUN: 2>&1 | FileCheck %s -check-prefix=NOSRAM
-// SRAM: {{.*}}clang{{.*}}"-target-feature" "+sram-ecc"
-// NOSRAM: {{.*}}clang{{.*}}"-target-feature" "-sram-ecc"
-// SRAM: {{.*}}lld{{.*}} "-plugin-opt=-mattr=+sram-ecc"
-// NOTSRAM: {{.*}}lld{{.*}} "-plugin-opt=-mattr=-sram-ecc"
+// SRAM: {{.*}}clang{{.*}}"-target-feature" "+sramecc"
+// NOSRAM: {{.*}}clang{{.*}}"-target-feature" "-sramecc"
+// SRAM: {{.*}}lld{{.*}} "-plugin-opt=-mattr=+sramecc"
+// NOTSRAM: {{.*}}lld{{.*}} "-plugin-opt=-mattr=-sramecc"
// RUN: %clang -### -target x86_64-linux-gnu -fgpu-rdc -nogpulib \
// RUN: --cuda-gpu-arch=gfx1010 %s \
@@ -39,14 +39,14 @@
// NOTCUMODE: {{.*}}lld{{.*}} "-plugin-opt=-mattr=-cumode"
// RUN: %clang -### -target x86_64-linux-gnu -fgpu-rdc -nogpulib \
-// RUN: --cuda-gpu-arch=gfx908:xnack+:sram-ecc+ %s \
+// RUN: --cuda-gpu-arch=gfx908:xnack+:sramecc+ %s \
// RUN: 2>&1 | FileCheck %s -check-prefix=ALL3
// RUN: %clang -### -target x86_64-linux-gnu -fgpu-rdc -nogpulib \
-// RUN: --cuda-gpu-arch=gfx908:xnack-:sram-ecc- %s \
+// RUN: --cuda-gpu-arch=gfx908:xnack-:sramecc- %s \
// RUN: 2>&1 | FileCheck %s -check-prefix=NOALL3
-// ALL3: {{.*}}clang{{.*}}"-target-feature" "+sram-ecc" "-target-feature" "+xnack"
-// NOALL3: {{.*}}clang{{.*}}"-target-feature" "-sram-ecc" "-target-feature" "-xnack"
+// ALL3: {{.*}}clang{{.*}}"-target-feature" "+sramecc" "-target-feature" "+xnack"
+// NOALL3: {{.*}}clang{{.*}}"-target-feature" "-sramecc" "-target-feature" "-xnack"
// RUN: %clang -### -target x86_64-linux-gnu -fgpu-rdc -nogpulib \
// RUN: --cuda-gpu-arch=gfx1010 %s \
diff --git a/clang/test/Driver/invalid-target-id.cl b/clang/test/Driver/invalid-target-id.cl
index e20f09745d71..a78a6e0ff86c 100644
--- a/clang/test/Driver/invalid-target-id.cl
+++ b/clang/test/Driver/invalid-target-id.cl
@@ -21,16 +21,16 @@
// UNK: error: Invalid target ID: gfx908:unknown+
// RUN: not %clang -target amdgcn-amd-amdhsa \
-// RUN: -mcpu=gfx908:sram-ecc+:unknown+ -nostdlib \
+// RUN: -mcpu=gfx908:sramecc+:unknown+ -nostdlib \
// RUN: %s 2>&1 | FileCheck -check-prefix=MIXED %s
-// MIXED: error: Invalid target ID: gfx908:sram-ecc+:unknown+
+// MIXED: error: Invalid target ID: gfx908:sramecc+:unknown+
// RUN: not %clang -target amdgcn-amd-amdhsa \
-// RUN: -mcpu=gfx900:sram-ecc+ -nostdlib \
+// RUN: -mcpu=gfx900:sramecc+ -nostdlib \
// RUN: %s 2>&1 | FileCheck -check-prefix=UNSUP %s
-// UNSUP: error: Invalid target ID: gfx900:sram-ecc+
+// UNSUP: error: Invalid target ID: gfx900:sramecc+
// RUN: not %clang -target amdgcn-amd-amdhsa \
// RUN: -mcpu=gfx900:xnack -nostdlib \
diff --git a/clang/test/Driver/target-id-macros.cl b/clang/test/Driver/target-id-macros.cl
index d440ca23d62a..9b00b72101d6 100644
--- a/clang/test/Driver/target-id-macros.cl
+++ b/clang/test/Driver/target-id-macros.cl
@@ -3,15 +3,15 @@
// REQUIRES: amdgpu-registered-target
// RUN: %clang -E -dM -target amdgcn-amd-amdhsa \
-// RUN: -mcpu=gfx908:xnack+:sram-ecc- -nogpulib -o - %s 2>&1 \
+// RUN: -mcpu=gfx908:xnack+:sramecc- -nogpulib -o - %s 2>&1 \
// RUN: | FileCheck -check-prefixes=PROC,ID1 %s
// RUN: %clang -E -dM -target amdgcn-amd-amdpal \
-// RUN: -mcpu=gfx908:xnack+:sram-ecc- -nogpulib -o - %s 2>&1 \
+// RUN: -mcpu=gfx908:xnack+:sramecc- -nogpulib -o - %s 2>&1 \
// RUN: | FileCheck -check-prefixes=PROC,ID1 %s
// RUN: %clang -E -dM -target amdgcn--mesa3d \
-// RUN: -mcpu=gfx908:xnack+:sram-ecc- -nogpulib -o - %s 2>&1 \
+// RUN: -mcpu=gfx908:xnack+:sramecc- -nogpulib -o - %s 2>&1 \
// RUN: | FileCheck -check-prefixes=PROC,ID1 %s
// RUN: %clang -E -dM -target amdgcn-amd-amdhsa \
@@ -25,14 +25,14 @@
// PROC-DAG: #define __amdgcn_processor__ "gfx908"
// ID1-DAG: #define __amdgcn_feature_xnack__ 1
-// ID1-DAG: #define __amdgcn_feature_sram_ecc__ 0
-// ID1-DAG: #define __amdgcn_target_id__ "gfx908:sram-ecc-:xnack+"
+// ID1-DAG: #define __amdgcn_feature_sramecc__ 0
+// ID1-DAG: #define __amdgcn_target_id__ "gfx908:sramecc-:xnack+"
// ID2-DAG: #define __amdgcn_target_id__ "gfx908"
// ID2-NOT: #define __amdgcn_feature_xnack__
-// ID2-NOT: #define __amdgcn_feature_sram_ecc__
+// ID2-NOT: #define __amdgcn_feature_sramecc__
// NONE-NOT: #define __amdgcn_processor__
// NONE-NOT: #define __amdgcn_feature_xnack__
-// NONE-NOT: #define __amdgcn_feature_sram_ecc__
+// NONE-NOT: #define __amdgcn_feature_sramecc__
// NONE-NOT: #define __amdgcn_target_id__
diff --git a/clang/test/Driver/target-id-macros.hip b/clang/test/Driver/target-id-macros.hip
index fdb9733a6bb7..c34545078908 100644
--- a/clang/test/Driver/target-id-macros.hip
+++ b/clang/test/Driver/target-id-macros.hip
@@ -3,10 +3,10 @@
// REQUIRES: amdgpu-registered-target
// RUN: %clang -E -dM -target x86_64-linux-gnu --cuda-device-only \
-// RUN: --offload-arch=gfx908:xnack+:sram-ecc- -nogpuinc -nogpulib \
+// RUN: --offload-arch=gfx908:xnack+:sramecc- -nogpuinc -nogpulib \
// RUN: -o - %s 2>&1 | FileCheck %s
// CHECK-DAG: #define __amdgcn_processor__ "gfx908"
// CHECK-DAG: #define __amdgcn_feature_xnack__ 1
-// CHECK-DAG: #define __amdgcn_feature_sram_ecc__ 0
-// CHECK-DAG: #define __amdgcn_target_id__ "gfx908:sram-ecc-:xnack+"
+// CHECK-DAG: #define __amdgcn_feature_sramecc__ 0
+// CHECK-DAG: #define __amdgcn_target_id__ "gfx908:sramecc-:xnack+"
diff --git a/clang/test/Driver/target-id.cl b/clang/test/Driver/target-id.cl
index 114ad98b9281..b9b5aab94a86 100644
--- a/clang/test/Driver/target-id.cl
+++ b/clang/test/Driver/target-id.cl
@@ -3,30 +3,30 @@
// REQUIRES: amdgpu-registered-target
// RUN: %clang -### -target amdgcn-amd-amdhsa \
-// RUN: -mcpu=gfx908:xnack+:sram-ecc- \
+// RUN: -mcpu=gfx908:xnack+:sramecc- \
// RUN: -nostdlib %s 2>&1 | FileCheck %s
// RUN: %clang -### -target amdgcn-amd-amdhsa \
-// RUN: -mcpu=gfx908:xnack+:sram-ecc- \
+// RUN: -mcpu=gfx908:xnack+:sramecc- \
// RUN: -nostdlib -x ir %s 2>&1 | FileCheck %s
// RUN: %clang -### -target amdgcn-amd-amdhsa \
-// RUN: -mcpu=gfx908:xnack+:sram-ecc- \
+// RUN: -mcpu=gfx908:xnack+:sramecc- \
// RUN: -nostdlib -x assembler %s 2>&1 | FileCheck %s
// RUN: %clang -### -target amdgcn-amd-amdpal \
-// RUN: -mcpu=gfx908:xnack+:sram-ecc- \
+// RUN: -mcpu=gfx908:xnack+:sramecc- \
// RUN: -nostdlib %s 2>&1 | FileCheck %s
// RUN: %clang -### -target amdgcn--mesa3d \
-// RUN: -mcpu=gfx908:xnack+:sram-ecc- \
+// RUN: -mcpu=gfx908:xnack+:sramecc- \
// RUN: -nostdlib %s 2>&1 | FileCheck %s
// RUN: %clang -### -target amdgcn-amd-amdhsa \
// RUN: -nostdlib %s 2>&1 | FileCheck -check-prefix=NONE %s
// CHECK: "-target-cpu" "gfx908"
-// CHECK-SAME: "-target-feature" "-sram-ecc"
+// CHECK-SAME: "-target-feature" "-sramecc"
// CHECK-SAME: "-target-feature" "+xnack"
// NONE-NOT: "-target-cpu"
diff --git a/llvm/include/llvm/Support/TargetParser.h b/llvm/include/llvm/Support/TargetParser.h
index 1d82dd80df04..450e713f27f2 100644
--- a/llvm/include/llvm/Support/TargetParser.h
+++ b/llvm/include/llvm/Support/TargetParser.h
@@ -125,7 +125,7 @@ enum ArchFeatureKind : uint32_t {
FEATURE_XNACK = 1 << 7,
// Sram-ecc is available.
- FEATURE_SRAM_ECC = 1 << 8,
+ FEATURE_SRAMECC = 1 << 8,
};
StringRef getArchNameAMDGCN(GPUKind AK);
diff --git a/llvm/lib/Support/TargetParser.cpp b/llvm/lib/Support/TargetParser.cpp
index b58fadfc765d..9c737f19cbeb 100644
--- a/llvm/lib/Support/TargetParser.cpp
+++ b/llvm/lib/Support/TargetParser.cpp
@@ -101,8 +101,8 @@ constexpr GPUInfo AMDGCNGPUs[] = {
{{"gfx900"}, {"gfx900"}, GK_GFX900, FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
{{"gfx902"}, {"gfx902"}, GK_GFX902, FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
{{"gfx904"}, {"gfx904"}, GK_GFX904, FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
- {{"gfx906"}, {"gfx906"}, GK_GFX906, FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK|FEATURE_SRAM_ECC},
- {{"gfx908"}, {"gfx908"}, GK_GFX908, FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK|FEATURE_SRAM_ECC},
+ {{"gfx906"}, {"gfx906"}, GK_GFX906, FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK|FEATURE_SRAMECC},
+ {{"gfx908"}, {"gfx908"}, GK_GFX908, FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK|FEATURE_SRAMECC},
{{"gfx909"}, {"gfx909"}, GK_GFX909, FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
{{"gfx90c"}, {"gfx90c"}, GK_GFX90C, FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_XNACK},
{{"gfx1010"}, {"gfx1010"}, GK_GFX1010, FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_WAVE32|FEATURE_XNACK},
More information about the cfe-commits
mailing list