Skip to content

Commit e96edde

Browse files
committed
Reland "[X86][AVX10] Fix a bug when using -march with no-evex512 attribute (#72126)"
Fixes #72106
1 parent 17dd0c7 commit e96edde

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

clang/lib/Basic/Targets/X86.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ bool X86TargetInfo::initFeatureMap(
122122
std::vector<std::string> UpdatedAVX10FeaturesVec;
123123
enum { FE_NOSET = -1, FE_FALSE, FE_TRUE };
124124
int HasEVEX512 = FE_NOSET;
125-
bool HasAVX512F = false;
126-
bool HasAVX10 = false;
127-
bool HasAVX10_512 = false;
125+
bool HasAVX512F = Features.lookup("avx512f");
126+
bool HasAVX10 = Features.lookup("avx10.1-256");
127+
bool HasAVX10_512 = Features.lookup("avx10.1-512");
128128
std::string LastAVX10;
129129
std::string LastAVX512;
130130
for (const auto &Feature : FeaturesVec) {

clang/test/CodeGen/X86/pr72106.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: %clang_cc1 -triple x86_64 -ffreestanding -target-cpu cannonlake -emit-llvm < %s | FileCheck %s
2+
3+
#include <immintrin.h>
4+
5+
int main(int argc, char **argv) {
6+
// CHECK-LABEL: @main
7+
// CHECK: @llvm.masked.load.v4i64.p0
8+
__m256i ptrs = _mm256_maskz_loadu_epi64(0, argv);
9+
return 0;
10+
}

0 commit comments

Comments
 (0)