-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
[X86][EVEX512] Restrict attaching EVEX512 for default CPU only, NFCI #65920
Conversation
Attaching EVEX512 is used to provide backward compatibility for legacy LLVM IR files, which didn't set EVEX512 feature explicitly. AVX512 and AVX10 targets have set or unset EVEX512 properly through X86.td. However, it's not feasible to list all AVX512 and AVX10 targets or their complementary set here to skip/restrict such code. Instead, we can restrict it for default CPU only. "generic" is used when "target-cpu" is not specified in IR, while "pentium4" and "x86-64" is the default CPU if "-march" is not specified in Clang for 32-bit and 64-bit targets respectively. This patch is no functional change intended, though it might affect scenarios like "-march=broadwell -mavx512dw", which looks like a misuse of "-march" and can be solved by changing to "-mtune=broadwell -mavx512dw".
-mavx512dw -> -mavx512bw |
|
||
if (posAVX512F != StringRef::npos && | ||
(posNoAVX512F == StringRef::npos || posNoAVX512F < posAVX512F)) | ||
if (posEVEX512 == StringRef::npos && posNoEVEX512 == StringRef::npos) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combine two if to one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think keeping it separate is friendly to understand. This outer logic is for AVX512 and inner is for EVEX512.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with two comments
Where's the second comment? |
Oh, just saw it. Modified! |
…lvm#65920) Attaching EVEX512 is used to provide backward compatibility for legacy LLVM IR files, which didn't set EVEX512 feature explicitly. AVX512 and AVX10 targets have set or unset EVEX512 properly through X86.td. However, it's not feasible to list all AVX512 and AVX10 targets or their complementary set here to skip/restrict such code. Instead, we can restrict it for default CPU only. "generic" is used when "target-cpu" is not specified in IR, while "pentium4" and "x86-64" is the default CPU if "-march" is not specified in Clang for 32-bit and 64-bit targets respectively. This patch is no functional change intended, though it might affect scenarios like "-march=broadwell -mavx512bw", which looks like a misuse of "-march" and can be solved by changing to "-mtune=broadwell -mavx512bw".
sorry for the late problem, seems our qmcpack app may have made a recent change that exposed this issue: llc: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:7536: llvm::SDValue getMemcpyLoadsAndStores(llvm::SelectionDAG&, const llvm::SDLoc&, llvm::SDValue, llvm::SDValue, llvm::SDValue, uint64_t, llvm::Align, bool, bool, llvm::MachinePointerInfo, llvm::MachinePointerInfo, const llvm::AAMDNodes&, llvm::AAResults*): Assertion `NVT.bitsGE(VT)' failed. |
…y, NFCI (llvm#65920)" breaks qmcpack This reverts commit 8a58407. Change-Id: Ife1e7e0c5e9ab5a2349b57dde856cae023579b7a
Solves crash mentioned in llvm#65920.
@ronlieb Thanks for reporting this issue! This exposed a bug not for this patch but a related one 2419409, which should be solved by #70420. |
Solves crash mentioned in #65920.
…lvm#65920) Attaching EVEX512 is used to provide backward compatibility for legacy LLVM IR files, which didn't set EVEX512 feature explicitly. AVX512 and AVX10 targets have set or unset EVEX512 properly through X86.td. However, it's not feasible to list all AVX512 and AVX10 targets or their complementary set here to skip/restrict such code. Instead, we can restrict it for default CPU only. "generic" is used when "target-cpu" is not specified in IR, while "pentium4" and "x86-64" is the default CPU if "-march" is not specified in Clang for 32-bit and 64-bit targets respectively. This patch is no functional change intended, though it might affect scenarios like "-march=broadwell -mavx512bw", which looks like a misuse of "-march" and can be solved by changing to "-mtune=broadwell -mavx512bw". Change-Id: Ia9ffa97056923b45f01e663a0df6c0c01fa69fe5
Attaching EVEX512 is used to provide backward compatibility for legacy
LLVM IR files, which didn't set EVEX512 feature explicitly.
AVX512 and AVX10 targets have set or unset EVEX512 properly through
X86.td.
However, it's not feasible to list all AVX512 and AVX10 targets or their
complementary set here to skip/restrict such code.
Instead, we can restrict it for default CPU only. "generic" is used when
"target-cpu" is not specified in IR, while "pentium4" and "x86-64" is
the default CPU if "-march" is not specified in Clang for 32-bit and
64-bit targets respectively.
This patch is no functional change intended, though it might affect
scenarios like "-march=broadwell -mavx512bw", which looks like a misuse
of "-march" and can be solved by changing to "-mtune=broadwell -mavx512bw".