[PATCH] D159250: [X86][RFC] Add new option `-m[no-]evex512` to disable ZMM and 64-bit mask instructions for AVX512 features

Phoebe Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 4 00:10:13 PDT 2023


pengfei added inline comments.


================
Comment at: llvm/lib/Target/X86/X86Subtarget.cpp:271
 
+  // Attach EVEX512 feature when we have AVX512 features and EVEX512 is not set.
+  size_t posNoEVEX512 = FS.rfind("-evex512");
----------------
skan wrote:
> It seems the change in X86.cpp is redundant?
It's not. We need `FeatureEVEX512` because it's independent of `FeatureAVX512`. We will have future AVX10-256 targets that have `FeatureAVX512` only.
Here we handle old IR that don't set `evex512` in function attributes.


================
Comment at: llvm/lib/Target/X86/X86Subtarget.cpp:275
+  size_t posEVEX512 = FS.rfind("+evex512");
+  size_t posAVX512F = FS.rfind("+avx512");
+
----------------
skan wrote:
> Missing f?
No, it's intentional. Sometimes, feature attributes may not have a full set of AVX512 features. If user only use e.g., "avx512bw", we should make sure "evex512" attached too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159250/new/

https://reviews.llvm.org/D159250



More information about the cfe-commits mailing list