Skip to content

[X86][AVX10] Fix a bug when using -march with no-evex512 attribute #72126

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 8 commits into from
Nov 14, 2023
6 changes: 3 additions & 3 deletions clang/lib/Basic/Targets/X86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ bool X86TargetInfo::initFeatureMap(
std::vector<std::string> UpdatedAVX10FeaturesVec;
enum { FE_NOSET = -1, FE_FALSE, FE_TRUE };
int HasEVEX512 = FE_NOSET;
bool HasAVX512F = false;
bool HasAVX10 = false;
bool HasAVX10_512 = false;
bool HasAVX512F = Features.lookup("avx512f");
bool HasAVX10 = Features.lookup("avx10.1-256");
bool HasAVX10_512 = Features.lookup("avx10.1-512");
std::string LastAVX10;
std::string LastAVX512;
for (const auto &Feature : FeaturesVec) {
Expand Down
10 changes: 10 additions & 0 deletions clang/test/CodeGen/X86/pr72106.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: %clang_cc1 -ffreestanding -target-cpu cannonlake -emit-llvm < %s | FileCheck %s

#include <immintrin.h>

int main(int argc, char **argv) {
// CHECK-LABEL: @main
// CHECK: @llvm.masked.load.v4i64.p0
__m256i ptrs = _mm256_maskz_loadu_epi64(0, argv);
return 0;
}