[clang] [X86][AVX10] Make warning message more informative, NFCI (PR #134528)
Phoebe Wang via cfe-commits
cfe-commits at lists.llvm.org
Sun Apr 6 03:24:06 PDT 2025
https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/134528
None
>From 04852072c016e6df3c9b6d834ba34c443593aa04 Mon Sep 17 00:00:00 2001
From: "Wang, Phoebe" <phoebe.wang at intel.com>
Date: Sun, 6 Apr 2025 18:22:22 +0800
Subject: [PATCH] [X86][AVX10] Make warning message more informative, NFCI
---
clang/lib/Driver/ToolChains/Arch/X86.cpp | 8 ++++++--
clang/test/Driver/x86-target-features.c | 4 ++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/clang/lib/Driver/ToolChains/Arch/X86.cpp b/clang/lib/Driver/ToolChains/Arch/X86.cpp
index 429b041c9c513..e6ac3a9e4b350 100644
--- a/clang/lib/Driver/ToolChains/Arch/X86.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/X86.cpp
@@ -252,7 +252,9 @@ void x86::getX86TargetFeatures(const Driver &D, const llvm::Triple &Triple,
D.Diag(diag::warn_drv_deprecated_arg) << Name << 1 << Name.drop_back(4);
else if (Width == "256")
D.Diag(diag::warn_drv_deprecated_custom)
- << Name << "because AVX10/256 is not supported and will be removed";
+ << Name
+ << "no alternative argument provided because "
+ "AVX10/256 is not supported and will be removed";
else
assert((Width == "256" || Width == "512") && "Invalid vector length.");
Features.push_back(Args.MakeArgString((IsNegative ? "-" : "+") + Name));
@@ -286,7 +288,9 @@ void x86::getX86TargetFeatures(const Driver &D, const llvm::Triple &Triple,
if (A->getOption().matches(options::OPT_mevex512) ||
A->getOption().matches(options::OPT_mno_evex512))
D.Diag(diag::warn_drv_deprecated_custom)
- << Name << "because AVX10/256 is not supported and will be removed";
+ << Name
+ << "no alternative argument provided because "
+ "AVX10/256 is not supported and will be removed";
if (A->getOption().matches(options::OPT_mapx_features_EQ) ||
A->getOption().matches(options::OPT_mno_apx_features_EQ)) {
diff --git a/clang/test/Driver/x86-target-features.c b/clang/test/Driver/x86-target-features.c
index 6416a34898e78..9c18098c87026 100644
--- a/clang/test/Driver/x86-target-features.c
+++ b/clang/test/Driver/x86-target-features.c
@@ -411,8 +411,8 @@
// RUN: %clang --target=i386 -mavx10.2-512 %s -### -o %t.o 2>&1 | FileCheck -check-prefixes=AVX10_2_512,WARN-AVX10-512 %s
// RUN: %clang --target=i386 -mavx10.2-256 -mavx10.1-512 %s -### -o %t.o 2>&1 | FileCheck -check-prefixes=AVX10_2_256,AVX10_1_512 %s
// RUN: %clang --target=i386 -mavx10.2-512 -mavx10.1-256 %s -### -o %t.o 2>&1 | FileCheck -check-prefixes=AVX10_2_512,AVX10_1_256 %s
-// WARN-EVEX512: warning: argument '{{.*}}evex512' is deprecated, because AVX10/256 is not supported and will be removed [-Wdeprecated]
-// WARN-AVX10-256: warning: argument 'avx10.{{.*}}-256' is deprecated, because AVX10/256 is not supported and will be removed [-Wdeprecated]
+// WARN-EVEX512: warning: argument '{{.*}}evex512' is deprecated, no alternative argument provided because AVX10/256 is not supported and will be removed [-Wdeprecated]
+// WARN-AVX10-256: warning: argument 'avx10.{{.*}}-256' is deprecated, no alternative argument provided because AVX10/256 is not supported and will be removed [-Wdeprecated]
// WARN-AVX10-512: warning: argument 'avx10.{{.*}}-512' is deprecated, use 'avx10.{{.*}}' instead [-Wdeprecated]
// EVEX512: "-target-feature" "+evex512"
// NO-EVEX512: "-target-feature" "-evex512"
More information about the cfe-commits
mailing list