[clang] 30e7cd4 - [clang] Remove legacy -m(no)-code-object-v3 options
via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 27 00:34:06 PDT 2023
Author: pvanhout
Date: 2023-03-27T09:33:59+02:00
New Revision: 30e7cd48778b3fbbf41b666f40423297c3b19d96
URL: https://github.com/llvm/llvm-project/commit/30e7cd48778b3fbbf41b666f40423297c3b19d96
DIFF: https://github.com/llvm/llvm-project/commit/30e7cd48778b3fbbf41b666f40423297c3b19d96.diff
LOG: [clang] Remove legacy -m(no)-code-object-v3 options
Code object V2 and V3 have been deprecated for a long time.
They're now scheduled to be removed completely from LLVM in the coming weeks/months.
There is no reason to support those legacy options anymore as they've
also been deprecated for a long time.
Reviewed By: #amdgpu, yaxunl, artem.tamazov
Differential Revision: https://reviews.llvm.org/D145671
Added:
Modified:
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/test/Driver/amdgpu-features.c
clang/test/Driver/hip-code-object-version.hip
Removed:
clang/test/Driver/amdgpu-features-as.s
################################################################################
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 6eda29771cf96..2f81f60a63995 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -3792,10 +3792,6 @@ def mcode_object_version_EQ : Joined<["-"], "mcode-object-version=">, Group<m_Gr
NormalizedValues<["COV_None", "COV_2", "COV_3", "COV_4", "COV_5"]>,
MarshallingInfoEnum<TargetOpts<"CodeObjectVersion">, "COV_4">;
-defm code_object_v3_legacy : SimpleMFlag<"code-object-v3",
- "Legacy option to specify code object ABI V3",
- "Legacy option to specify code object ABI V2",
- " (AMDGPU only)">;
defm cumode : SimpleMFlag<"cumode",
"Specify CU wavefront", "Specify WGP wavefront",
" execution mode (AMDGPU only)", m_amdgpu_Features_Group>;
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 9074b572c3991..4273373f62f35 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -2177,11 +2177,7 @@ void tools::AddStaticDeviceLibs(Compilation *C, const Tool *T,
static llvm::opt::Arg *
getAMDGPUCodeObjectArgument(const Driver &D, const llvm::opt::ArgList &Args) {
- // The last of -mcode-object-v3, -mno-code-object-v3 and
- // -mcode-object-version=<version> wins.
- return Args.getLastArg(options::OPT_mcode_object_v3_legacy,
- options::OPT_mno_code_object_v3_legacy,
- options::OPT_mcode_object_version_EQ);
+ return Args.getLastArg(options::OPT_mcode_object_version_EQ);
}
void tools::checkAMDGPUCodeObjectVersion(const Driver &D,
@@ -2189,15 +2185,6 @@ void tools::checkAMDGPUCodeObjectVersion(const Driver &D,
const unsigned MinCodeObjVer = 2;
const unsigned MaxCodeObjVer = 5;
- // Emit warnings for legacy options even if they are overridden.
- if (Args.hasArg(options::OPT_mno_code_object_v3_legacy))
- D.Diag(diag::warn_drv_deprecated_arg) << "-mno-code-object-v3"
- << "-mcode-object-version=2";
-
- if (Args.hasArg(options::OPT_mcode_object_v3_legacy))
- D.Diag(diag::warn_drv_deprecated_arg) << "-mcode-object-v3"
- << "-mcode-object-version=3";
-
if (auto *CodeObjArg = getAMDGPUCodeObjectArgument(D, Args)) {
if (CodeObjArg->getOption().getID() ==
options::OPT_mcode_object_version_EQ) {
@@ -2214,17 +2201,8 @@ void tools::checkAMDGPUCodeObjectVersion(const Driver &D,
unsigned tools::getAMDGPUCodeObjectVersion(const Driver &D,
const llvm::opt::ArgList &Args) {
unsigned CodeObjVer = 4; // default
- if (auto *CodeObjArg = getAMDGPUCodeObjectArgument(D, Args)) {
- if (CodeObjArg->getOption().getID() ==
- options::OPT_mno_code_object_v3_legacy) {
- CodeObjVer = 2;
- } else if (CodeObjArg->getOption().getID() ==
- options::OPT_mcode_object_v3_legacy) {
- CodeObjVer = 3;
- } else {
- StringRef(CodeObjArg->getValue()).getAsInteger(0, CodeObjVer);
- }
- }
+ if (auto *CodeObjArg = getAMDGPUCodeObjectArgument(D, Args))
+ StringRef(CodeObjArg->getValue()).getAsInteger(0, CodeObjVer);
return CodeObjVer;
}
diff --git a/clang/test/Driver/amdgpu-features-as.s b/clang/test/Driver/amdgpu-features-as.s
deleted file mode 100644
index 6e810c167ddf8..0000000000000
--- a/clang/test/Driver/amdgpu-features-as.s
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %clang -### -target amdgcn-amd-amdhsa -mcpu=gfx900 -mcode-object-v3 %s 2>&1 | FileCheck --check-prefix=CODE-OBJECT-V3 %s
-// CODE-OBJECT-V3: warning: argument '-mcode-object-v3' is deprecated, use '-mcode-object-version=3' instead [-Wdeprecated]
-// CODE-OBJECT-V3: "-mllvm" "--amdhsa-code-object-version=3"
-
-// RUN: %clang -### -target amdgcn-amd-amdhsa amdgcn -mcpu=gfx900 -mno-code-object-v3 %s 2>&1 | FileCheck --check-prefix=NO-CODE-OBJECT-V3 %s
-// NO-CODE-OBJECT-V3: warning: argument '-mno-code-object-v3' is deprecated, use '-mcode-object-version=2' instead [-Wdeprecated]
-// NO-CODE-OBJECT-V3: "-mllvm" "--amdhsa-code-object-version=2"
-
-// RUN: %clang -### -target amdgcn-amd-amdhsa -mcpu=gfx900 -mcode-object-v3 -mno-code-object-v3 -mcode-object-v3 %s 2>&1 | FileCheck --check-prefix=MUL-CODE-OBJECT-V3 %s
-// MUL-CODE-OBJECT-V3: warning: argument '-mcode-object-v3' is deprecated, use '-mcode-object-version=3' instead [-Wdeprecated]
-// MUL-CODE-OBJECT-V3: "-mllvm" "--amdhsa-code-object-version=3"
diff --git a/clang/test/Driver/amdgpu-features.c b/clang/test/Driver/amdgpu-features.c
index 98383cd53410c..e4ff422d8ebad 100644
--- a/clang/test/Driver/amdgpu-features.c
+++ b/clang/test/Driver/amdgpu-features.c
@@ -1,15 +1,3 @@
-// RUN: %clang -### -target amdgcn-amd-amdhsa -mcpu=gfx700 -mcode-object-v3 %s 2>&1 | FileCheck --check-prefix=CODE-OBJECT-V3 %s
-// CODE-OBJECT-V3: warning: argument '-mcode-object-v3' is deprecated, use '-mcode-object-version=3' instead [-Wdeprecated]
-// CODE-OBJECT-V3: "-mllvm" "--amdhsa-code-object-version=3"
-
-// RUN: %clang -### -target amdgcn-amd-amdhsa amdgcn -mcpu=gfx700 -mno-code-object-v3 %s 2>&1 | FileCheck --check-prefix=NO-CODE-OBJECT-V3 %s
-// NO-CODE-OBJECT-V3: warning: argument '-mno-code-object-v3' is deprecated, use '-mcode-object-version=2' instead [-Wdeprecated]
-// NO-CODE-OBJECT-V3: "-mllvm" "--amdhsa-code-object-version=2"
-
-// RUN: %clang -### -target amdgcn-amd-amdhsa -mcpu=gfx700 -mcode-object-v3 -mno-code-object-v3 -mcode-object-v3 %s 2>&1 | FileCheck --check-prefix=MUL-CODE-OBJECT-V3 %s
-// MUL-CODE-OBJECT-V3: warning: argument '-mcode-object-v3' is deprecated, use '-mcode-object-version=3' instead [-Wdeprecated]
-// MUL-CODE-OBJECT-V3: "-mllvm" "--amdhsa-code-object-version=3"
-
// RUN: %clang -### -target amdgcn-amdhsa -mcpu=gfx900:xnack+ %s 2>&1 | FileCheck --check-prefix=XNACK %s
// XNACK: "-target-feature" "+xnack"
diff --git a/clang/test/Driver/hip-code-object-version.hip b/clang/test/Driver/hip-code-object-version.hip
index 33aa39f556ca5..a2968781224db 100644
--- a/clang/test/Driver/hip-code-object-version.hip
+++ b/clang/test/Driver/hip-code-object-version.hip
@@ -2,27 +2,16 @@
// Check bundle ID for code object v2.
-// RUN: %clang -### --target=x86_64-linux-gnu \
-// RUN: -mno-code-object-v3 \
-// RUN: --offload-arch=gfx906 -nogpulib \
-// RUN: %s 2>&1 | FileCheck -check-prefixes=V2,V2-WARN %s
-
// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: -mcode-object-version=2 \
// RUN: --offload-arch=gfx906 -nogpulib \
// RUN: %s 2>&1 | FileCheck -check-prefix=V2 %s
-// V2-WARN: warning: argument '-mno-code-object-v3' is deprecated, use '-mcode-object-version=2' instead [-Wdeprecated]
// V2: "-mllvm" "--amdhsa-code-object-version=2"
// V2: "-targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa--gfx906"
// Check bundle ID for code object v3.
-// RUN: %clang -### --target=x86_64-linux-gnu \
-// RUN: -mcode-object-v3 \
-// RUN: --offload-arch=gfx906 -nogpulib \
-// RUN: %s 2>&1 | FileCheck -check-prefixes=V3,V3-WARN %s
-
// RUN: %clang -### --target=x86_64-linux-gnu \
// RUN: -mcode-object-version=3 \
// RUN: --offload-arch=gfx906 -nogpulib \
@@ -33,7 +22,6 @@
// RUN: --offload-arch=gfx906 -nogpulib \
// RUN: %s 2>&1 | FileCheck -check-prefix=V3 %s
-// V3-WARN: warning: argument '-mcode-object-v3' is deprecated, use '-mcode-object-version=3' instead [-Wdeprecated]
// V3: "-mcode-object-version=3"
// V3: "-mllvm" "--amdhsa-code-object-version=3"
// V3: "-targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa--gfx906"
@@ -95,14 +83,3 @@
// RUN: %s 2>&1 | FileCheck -check-prefix=CC1NEG %s
// CC1NEG-NOT: "-cc1as" {{.*}}"-mcode-object-version=5"
-
-// Check warnings are emitted for legacy options before -mcode-object-version options.
-// Check warnings are emitted only once.
-
-// RUN: %clang -### --target=x86_64-linux-gnu \
-// RUN: -mno-code-object-v3 -mcode-object-v3 -mcode-object-version=4 \
-// RUN: --offload-arch=gfx906 -nogpulib \
-// RUN: %s 2>&1 | FileCheck -check-prefixes=WARN %s
-// WARN: warning: argument '-mno-code-object-v3' is deprecated, use '-mcode-object-version=2' instead [-Wdeprecated]
-// WARN: warning: argument '-mcode-object-v3' is deprecated, use '-mcode-object-version=3' instead [-Wdeprecated]
-// WARN-NOT: warning: argument {{.*}} is deprecated
More information about the cfe-commits
mailing list