Skip to content

[X86] Emit Warnings for frontend options to enable knl/knm specific ISAs. #75580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 9, 2024

Conversation

FreddyLeaf
Copy link
Contributor

@FreddyLeaf FreddyLeaf commented Dec 15, 2023

Since Knight Landing and Knight Mill microarchitectures are EOL, we
would like to remove intrinsic supports for its specific ISA in LLVM 19.
In LLVM 18, we will first emit a warning for the usage.

Since Knight Landing and Knight Mill microarchitectures are EOL, we
would like to remove its support in LLVM 19. In LLVM 18, we will first
emit a warning for the usage.
@llvmbot llvmbot added clang Clang issues not falling into any other category backend:X86 clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Dec 15, 2023
@llvmbot
Copy link
Member

llvmbot commented Dec 15, 2023

@llvm/pr-subscribers-backend-x86
@llvm/pr-subscribers-clang-driver

@llvm/pr-subscribers-clang

Author: Freddy Ye (FreddyLeaf)

Changes

Since Knight Landing and Knight Mill microarchitectures are EOL, we
would like to remove its support in LLVM 19. In LLVM 18, we will first
emit a warning for the usage.


Full diff: https://github.com/llvm/llvm-project/pull/75580.diff

7 Files Affected:

  • (modified) clang/include/clang/Basic/DiagnosticCommonKinds.td (+2)
  • (modified) clang/lib/Basic/Targets/X86.cpp (+3)
  • (modified) clang/test/CodeGen/X86/avx512er-builtins.c (+1-1)
  • (modified) clang/test/CodeGen/X86/avx512pf-builtins.c (+1-1)
  • (modified) clang/test/Driver/cl-x86-flags.c (+8-2)
  • (modified) clang/test/Frontend/x86-target-cpu.c (+8-2)
  • (modified) clang/test/Misc/warning-flags.c (+2-1)
diff --git a/clang/include/clang/Basic/DiagnosticCommonKinds.td b/clang/include/clang/Basic/DiagnosticCommonKinds.td
index 65a33f61a6948a..40841e9df547bc 100644
--- a/clang/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/clang/include/clang/Basic/DiagnosticCommonKinds.td
@@ -349,6 +349,8 @@ def warn_invalid_feature_combination : Warning<
 def warn_target_unrecognized_env : Warning<
   "mismatch between architecture and environment in target triple '%0'; did you mean '%1'?">,
   InGroup<InvalidCommandLineArgument>;
+def warn_knl_knm_target_supports_remove : Warning<
+  "KNL/KNM's feature support will be removed in LLVM 19.">;
 
 // Source manager
 def err_cannot_open_file : Error<"cannot open file '%0': %1">, DefaultFatal;
diff --git a/clang/lib/Basic/Targets/X86.cpp b/clang/lib/Basic/Targets/X86.cpp
index b97f88647fa49f..dc56524d378104 100644
--- a/clang/lib/Basic/Targets/X86.cpp
+++ b/clang/lib/Basic/Targets/X86.cpp
@@ -295,11 +295,13 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
       HasAVX512BF16 = true;
     } else if (Feature == "+avx512er") {
       HasAVX512ER = true;
+      Diags.Report(diag::warn_knl_knm_target_supports_remove);
     } else if (Feature == "+avx512fp16") {
       HasAVX512FP16 = true;
       HasLegalHalfType = true;
     } else if (Feature == "+avx512pf") {
       HasAVX512PF = true;
+      Diags.Report(diag::warn_knl_knm_target_supports_remove);
     } else if (Feature == "+avx512dq") {
       HasAVX512DQ = true;
     } else if (Feature == "+avx512bitalg") {
@@ -358,6 +360,7 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
       HasPREFETCHI = true;
     } else if (Feature == "+prefetchwt1") {
       HasPREFETCHWT1 = true;
+      Diags.Report(diag::warn_knl_knm_target_supports_remove);
     } else if (Feature == "+clzero") {
       HasCLZERO = true;
     } else if (Feature == "+cldemote") {
diff --git a/clang/test/CodeGen/X86/avx512er-builtins.c b/clang/test/CodeGen/X86/avx512er-builtins.c
index ee31236a3c01aa..11ec6aabec1e3f 100644
--- a/clang/test/CodeGen/X86/avx512er-builtins.c
+++ b/clang/test/CodeGen/X86/avx512er-builtins.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512f -target-feature +avx512er -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512f -target-feature +avx512er -emit-llvm -o - -Wall | FileCheck %s
 
 
 #include <immintrin.h>
diff --git a/clang/test/CodeGen/X86/avx512pf-builtins.c b/clang/test/CodeGen/X86/avx512pf-builtins.c
index 4ca70f5787968b..3a117ed6a9460e 100644
--- a/clang/test/CodeGen/X86/avx512pf-builtins.c
+++ b/clang/test/CodeGen/X86/avx512pf-builtins.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512pf -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +avx512pf -emit-llvm -o - -Wall | FileCheck %s
 
 
 #include <immintrin.h>
diff --git a/clang/test/Driver/cl-x86-flags.c b/clang/test/Driver/cl-x86-flags.c
index 51b16f0ce35463..ae35a312fe8a4b 100644
--- a/clang/test/Driver/cl-x86-flags.c
+++ b/clang/test/Driver/cl-x86-flags.c
@@ -69,7 +69,10 @@
 // RUN: %clang_cl -m32 -arch:avx2 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx2 %s
 // avx2: invalid /arch: argument
 
-// RUN: %clang_cl -m32 -arch:AVX512F --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_32_ARCH_AVX512F -- %s
+// RUN: %clang_cl -m32 -arch:AVX512F --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify=KNL1 -DTEST_32_ARCH_AVX512F -- %s
+// KNL1-warning@*:* {{KNL/KNM's feature support will be removed in LLVM 19.}}
+// KNL1-warning@*:* {{KNL/KNM's feature support will be removed in LLVM 19.}}
+// KNL1-warning@*:* {{KNL/KNM's feature support will be removed in LLVM 19.}}
 #if defined(TEST_32_ARCH_AVX512F)
 #if _M_IX86_FP != 2 || !__AVX__ || !__AVX2__ || !__AVX512F__  || __AVX512BW__
 #error fail
@@ -109,7 +112,10 @@
 // RUN: %clang_cl -m64 -arch:avx2 --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx264 %s
 // avx264: invalid /arch: argument
 
-// RUN: %clang_cl -m64 -arch:AVX512F --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify -DTEST_64_ARCH_AVX512F -- %s
+// RUN: %clang_cl -m64 -arch:AVX512F --target=i386-pc-windows /c /Fo%t.obj -Xclang -verify=KNL2 -DTEST_64_ARCH_AVX512F -- %s
+// KNL2-warning@*:* {{KNL/KNM's feature support will be removed in LLVM 19.}}
+// KNL2-warning@*:* {{KNL/KNM's feature support will be removed in LLVM 19.}}
+// KNL2-warning@*:* {{KNL/KNM's feature support will be removed in LLVM 19.}}
 #if defined(TEST_64_ARCH_AVX512F)
 #if _M_IX86_FP || !__AVX__ || !__AVX2__ || !__AVX512F__  || __AVX512BW__
 #error fail
diff --git a/clang/test/Frontend/x86-target-cpu.c b/clang/test/Frontend/x86-target-cpu.c
index 6c8502ac2c21ee..be57b3c0ec583b 100644
--- a/clang/test/Frontend/x86-target-cpu.c
+++ b/clang/test/Frontend/x86-target-cpu.c
@@ -15,8 +15,14 @@
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu cannonlake -verify %s
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu icelake-client -verify %s
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu icelake-server -verify %s
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu knl -verify %s
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu knm -verify %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu knl -verify=knl %s
+// knl-warning@*:* {{KNL/KNM's feature support will be removed in LLVM 19.}}
+// knl-warning@*:* {{KNL/KNM's feature support will be removed in LLVM 19.}}
+// knl-warning@*:* {{KNL/KNM's feature support will be removed in LLVM 19.}}
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu knm -verify=knm %s
+// knm-warning@*:* {{KNL/KNM's feature support will be removed in LLVM 19.}}
+// knm-warning@*:* {{KNL/KNM's feature support will be removed in LLVM 19.}}
+// knm-warning@*:* {{KNL/KNM's feature support will be removed in LLVM 19.}}
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu bonnell -verify %s
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu silvermont -verify %s
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu k8 -verify %s
diff --git a/clang/test/Misc/warning-flags.c b/clang/test/Misc/warning-flags.c
index c587337da5933a..f580445b1f10b9 100644
--- a/clang/test/Misc/warning-flags.c
+++ b/clang/test/Misc/warning-flags.c
@@ -18,7 +18,7 @@ This test serves two purposes:
 
 The list of warnings below should NEVER grow.  It should gradually shrink to 0.
 
-CHECK: Warnings without flags (65):
+CHECK: Warnings without flags (66):
 
 CHECK-NEXT:   ext_expected_semi_decl_list
 CHECK-NEXT:   ext_explicit_specialization_storage_class
@@ -56,6 +56,7 @@ CHECK-NEXT:   warn_ignoring_ftabstop_value
 CHECK-NEXT:   warn_implements_nscopying
 CHECK-NEXT:   warn_incompatible_qualified_id
 CHECK-NEXT:   warn_invalid_asm_cast_lvalue
+CHECK-NEXT:   warn_knl_knm_target_supports_remove
 CHECK-NEXT:   warn_maynot_respond
 CHECK-NEXT:   warn_method_param_redefinition
 CHECK-NEXT:   warn_missing_case_for_condition

@RKSimon
Copy link
Collaborator

RKSimon commented Dec 15, 2023

Why do you want to remove these? We don't support any of the more exotic behaviors of Xeon Phi, but removing a x86 cpu just because its EOL doesn't make sense to me.

@FreddyLeaf
Copy link
Contributor Author

Let me first paste reasons I listed before:

  1. INTEL has officially announced these products’ EOL on about Aug. 2017
  2. Even for now, clang/llvm’s supports on these products are incomplete. For example, knm targets has AVX5124FMAPS instructions, while its intrinsic and assembly support is missing. And it is weird that avx5124fmaps is still listed at llvm/include/llvm/TargetParser/X86TargetParser.def.
  3. It sometimes leads to bad performance by wrong usage of options.
  4. We can claim this change on release notes to notify users intentionally support these targets to use older releases.

@FreddyLeaf
Copy link
Contributor Author

And here're two more reasons I collected from gcc:

  1. previously ICC and ICX has removed the support and emitted errors
  2. we would also like to remove the support in GCC to reduce maintainence effort.

@phoebewang
Copy link
Contributor

One more reason I can think of is with KNL/KNM removal, we can simplify supporting widen 128/256-bit vector to 512-bit without AVX512VL feature since all reset targets support AVX512VL. The test cases can be simplified too.

@KanRobert
Copy link
Contributor

One more justification...
https://www.felixcloutier.com/x86/vscatterpf0dps:vscatterpf0qps:vscatterpf0dpd:vscatterpf0qpd

The assembler support for some KNL instructions is buggy

## AsmParser is buggy for this KNC instruction

If we deprecate KNL, the bug can go away.

@RKSimon
Copy link
Collaborator

RKSimon commented Dec 19, 2023

Can you give me a better idea of the stages you intend to follow with this. The patch title suggests removing all KNL/KNM handling but the patch itself looks to be just about the KNL/KNM specific features.

Removing the (incomplete) KNL/KNM specific features (ER/PF/etc) I don't think will be any major cause for concern, ideally we'd keep support at the assembly level only (which has been suggested for MMX as well at some point). But even that might not be necessary.

But what do you expect to happen if a KNL workstation attempts to use clang 19 with -march=native? Do we still enable it as a AVX512F+AVX512CD target or are you suggesting we degrade it to match x86-64-v3 arch spec?

How can the test cases then can be simplified? Are you suggesting that we merge more of the AVX512 attributes in X86.td (e.g. AVX512VL always enables BW/DQ / VBMI2 enables VBMI etc?).

@phoebewang
Copy link
Contributor

Can you give me a better idea of the stages you intend to follow with this. The patch title suggests removing all KNL/KNM handling but the patch itself looks to be just about the KNL/KNM specific features.

Removing the (incomplete) KNL/KNM specific features (ER/PF/etc) I don't think will be any major cause for concern, ideally we'd keep support at the assembly level only (which has been suggested for MMX as well at some point). But even that might not be necessary.

It's a good idea to preserve the assembly level support. I think GCC's proposal just wants to deprecate GCC support rather than remove support from binutils too.

But what do you expect to happen if a KNL workstation attempts to use clang 19 with -march=native? Do we still enable it as a AVX512F+AVX512CD target or are you suggesting we degrade it to match x86-64-v3 arch spec?

There're discussions in GCC mailing loop about -mtune/arch=knl. IIUC, the final decision is to remove the march support too. For -march=native, I'm not sure whether we detect it by CPU model or feature list. For the former, we didn't remove the KNL/KNM model, we can emit error for it; for the latter, we can return an approaching target has the same (remaining) features.

How can the test cases then can be simplified? Are you suggesting that we merge more of the AVX512 attributes in X86.td (e.g. AVX512VL always enables BW/DQ / VBMI2 enables VBMI etc?).

I think we can't make AVX512VL being implied by default, but can gradually relax a lot of Subtarget.hasVLX() in CPP and TD files. We don't need to test the combinations that have AVX512 features but no AVX512VL and remove them from existing tests gradually.

From the developmental trend of HW design, I don't think we will fall back to support 512-bit only features in the future. So from my point of view, simplifying backend design and testing would be the major benefit we can achieve.

@FreddyLeaf
Copy link
Contributor Author

FreddyLeaf commented Dec 26, 2023

Can you give me a better idea of the stages you intend to follow with this. The patch title suggests removing all KNL/KNM handling but the patch itself looks to be just about the KNL/KNM specific features.

I have created a draft PR to do removal in next release: #76383. Comments are welcome there. For this PR, I added warnings to features only but not cpuname, mainly to reduce efforts. Especially when using -march=native on a knl machine, these warnings can also be emitted. Are you recommending removing features from the warning message?

@FreddyLeaf
Copy link
Contributor Author

ping for review
@RKSimon are we aligned on the direction to removing knl/knm supports in the end?

@RKSimon
Copy link
Collaborator

RKSimon commented Jan 2, 2024

I think if we have an approach that allows people to emulate a very basic KNL/KNM implementation with the equivalent of "-march=x86-64-v3 -mavx512f -mavx512cd" then that would be sufficient. I do think we should be keeping -march/tune support though for the knl/knm cpu model names, but we shouldn't need to support the xeon phi specific ISAs.

We should keep asm handling for avx512er/avx512pf/etc but no need for attributes/intrinsics handling for them - if somebody needs to write assembly for them we shouldn't prevent it.

We should retain -march=native detection if we can, but not mandatory.

I also think we need a policy regarding what test coverage we need for various avx512 features (when should we assume avx512vl etc.)

Does that sound OK?

@phoebewang
Copy link
Contributor

I also think we need a policy regarding what test coverage we need for various avx512 features (when should we assume avx512vl etc.)

Considering the new evolution in AVX10, we should switch testing model from avx512xxx ± avx512vl to avx512xxx + avx512vl ± evex512.
I also imagine we can turn any avx512 feature, e.g., bool hasBWI() {return HasBWI;} into bool hasBWI() {return HasBWI & HasVLX;}, then remove all hasVLX checks in the code, e.g., Subtarget.hasVLX() && Subtarget.hasBWI() to Subtarget.hasBWI().

I think if we have an approach that allows people to emulate a very basic KNL/KNM implementation with the equivalent of "-march=x86-64-v3 -mavx512f -mavx512cd" then that would be sufficient.

This will require compiler and tests continue to handle cases avx512f/avx512cd without avx512vl. It conflicts with my expectation for hasVLX clean up. But maybe we can preserve these handling for few features for a short period.

We should keep asm handling for avx512er/avx512pf/etc but no need for attributes/intrinsics handling for them - if somebody needs to write assembly for them we shouldn't prevent it.

+1

@FreddyLeaf
Copy link
Contributor Author

Keeping -march supports for knl/knm meanwhile removing the specific ISA's intrinsic supports doesn't sound quite good to me. And thanks @phoebewang mentioned, removing the KNL/KNM supports could make all other targets always support AVX512F and AVX512VL meanwhile. This can simplify large amounts of logic codes in backend, which is very beneficial.

@RKSimon
Copy link
Collaborator

RKSimon commented Jan 3, 2024

Making avx512f the only case where avx512vl can be disabled doesn't seem like too much of a stretch to me - we'd be merely making all avx512 extension features depend on avx512vl.

@phoebewang
Copy link
Contributor

Making avx512f the only case where avx512vl can be disabled doesn't seem like too much of a stretch to me - we'd be merely making all avx512 extension features depend on avx512vl.

Agreed.

@RKSimon
Copy link
Collaborator

RKSimon commented Jan 3, 2024

Sorry, we'd require both avx512f and avx512cd to work without avx512vl - but everything afterward (avx512bw, avx512dq, ....) we could assume avx512vl is enabled.

@FreddyLeaf
Copy link
Contributor Author

@RKSimon @phoebewang Thanks comments! knm has AVX512_VPOPCNTDQ, I guess we also require it work without avx512vl? And we are going to keep -march/mtune/mcpu support for knl/knm, but removing some specific ISA's intrinsic and lowering supports? Did I get your point wrong?

@FreddyLeaf FreddyLeaf changed the title [X86] Emit Warnings for frontend options to enable knl/knm. [X86] Emit Warnings for frontend options to enable knl/knm specific ISAs. Jan 4, 2024
@FreddyLeaf
Copy link
Contributor Author

@RKSimon @phoebewang Thanks comments! knm has AVX512_VPOPCNTDQ, I guess we also require it work without avx512vl? And we are going to keep -march/mtune/mcpu support for knl/knm, but removing some specific ISA's intrinsic and lowering supports? Did I get your point wrong?

That's correct - we keep -march/mtune/mcpu support for knl/knm but reduce its feature set to avx512f/avx512cd and we don't provide any support for xeon-phi specific features (avx512pf etc.) apart from the minimal binutils/assembly handling necessary.

If we keep support for VPOPCNTDQ on knm then yes we will need to allow non-VLX handling, but I don't know much about general availability of knm workstations (knl cpus/machines do turn up on ebay etc. quite frequently).

Thanks confirming! Modified the warning message and commit title.

@FreddyLeaf
Copy link
Contributor Author

ping for review

@FreddyLeaf
Copy link
Contributor Author

ping for review.

Copy link
Contributor

@phoebewang phoebewang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Collaborator

@RKSimon RKSimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - please make sure you adjust the commit message (the patch summary doesn't refer to removing just the knl/knm specific ISAs)

@FreddyLeaf
Copy link
Contributor Author

Thank you all!

@FreddyLeaf FreddyLeaf merged commit 19870ed into llvm:main Jan 9, 2024
@FreddyLeaf FreddyLeaf deleted the warning_phi branch January 9, 2024 11:43
justinfargnoli pushed a commit to justinfargnoli/llvm-project that referenced this pull request Jan 28, 2024
…SAs. (llvm#75580)

Since Knight Landing and Knight Mill microarchitectures are EOL, we
would like to remove intrinsic supports for its specific ISA in LLVM 19.
In LLVM 18, we will first emit a warning for the usage.
FreddyLeaf added a commit that referenced this pull request May 23, 2024
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this pull request Aug 27, 2024
Clang 19 has removed support for the -mavx512pf and -mavx512er flags,
for the Intel Xeon Phi (aka "Knights Landing"/knl or "Knights
Mill"/knm) [1] [2].

This causes fatal errors during configuration of math/blis:

    Compiling obj/x86_64/kernels/knl/1m/bli_dpackm_knl_asm_24x8.o ('knl' CFLAGS for kernels)
    cc: fatal error: unknown argument '-mavx512pf'; did you mean '-mavx512f'?
    gmake: *** [Makefile:653: obj/x86_64/kernels/knl/1m/bli_dpackm_knl_asm_24x8.o] Error 1

Add an EXTRA_PATCHES entry to deal with this situation.

Note that in the future, this may also have to be done for gcc 15 and
later. In that case, the patch might be done unconditionally.

[1] llvm/llvm-project#75580
[2] llvm/llvm-project#92883

PR:		280783
Approved by:	maintainer timeout (2 weeks)
MFH:		2024Q3
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this pull request Aug 27, 2024
Clang 19 has removed support for the -mavx512pf and -mavx512er flags,
for the Intel Xeon Phi (aka "Knights Landing"/knl or "Knights
Mill"/knm) [1] [2].

This causes fatal errors during configuration of math/blis:

    Compiling obj/x86_64/kernels/knl/1m/bli_dpackm_knl_asm_24x8.o ('knl' CFLAGS for kernels)
    cc: fatal error: unknown argument '-mavx512pf'; did you mean '-mavx512f'?
    gmake: *** [Makefile:653: obj/x86_64/kernels/knl/1m/bli_dpackm_knl_asm_24x8.o] Error 1

Add an EXTRA_PATCHES entry to deal with this situation.

Note that in the future, this may also have to be done for gcc 15 and
later. In that case, the patch might be done unconditionally.

[1] llvm/llvm-project#75580
[2] llvm/llvm-project#92883

PR:		280783
Approved by:	maintainer timeout (2 weeks)
MFH:		2024Q3

(cherry picked from commit 885ff9e)
nanorkyo pushed a commit to nanorkyo/freebsd-ports that referenced this pull request Aug 31, 2024
Clang 19 has removed support for the -mavx512pf and -mavx512er flags,
for the Intel Xeon Phi (aka "Knights Landing"/knl or "Knights
Mill"/knm) [1] [2].

This causes fatal errors during configuration of math/blis:

    Compiling obj/x86_64/kernels/knl/1m/bli_dpackm_knl_asm_24x8.o ('knl' CFLAGS for kernels)
    cc: fatal error: unknown argument '-mavx512pf'; did you mean '-mavx512f'?
    gmake: *** [Makefile:653: obj/x86_64/kernels/knl/1m/bli_dpackm_knl_asm_24x8.o] Error 1

Add an EXTRA_PATCHES entry to deal with this situation.

Note that in the future, this may also have to be done for gcc 15 and
later. In that case, the patch might be done unconditionally.

[1] llvm/llvm-project#75580
[2] llvm/llvm-project#92883

PR:		280783
Approved by:	maintainer timeout (2 weeks)
MFH:		2024Q3
nanorkyo pushed a commit to nanorkyo/freebsd-ports that referenced this pull request Aug 31, 2024
Clang 19 has removed support for the -mavx512pf and -mavx512er flags,
for the Intel Xeon Phi (aka "Knights Landing"/knl or "Knights
Mill"/knm) [1] [2].

This causes fatal errors during configuration of math/blis:

    Compiling obj/x86_64/kernels/knl/1m/bli_dpackm_knl_asm_24x8.o ('knl' CFLAGS for kernels)
    cc: fatal error: unknown argument '-mavx512pf'; did you mean '-mavx512f'?
    gmake: *** [Makefile:653: obj/x86_64/kernels/knl/1m/bli_dpackm_knl_asm_24x8.o] Error 1

Add an EXTRA_PATCHES entry to deal with this situation.

Note that in the future, this may also have to be done for gcc 15 and
later. In that case, the patch might be done unconditionally.

[1] llvm/llvm-project#75580
[2] llvm/llvm-project#92883

PR:		280783
Approved by:	maintainer timeout (2 weeks)
MFH:		2024Q3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants