Skip to content

Commit

Permalink
[X86][AVX10] Fix a bug when using -march with no-evex512 attribute (#…
Browse files Browse the repository at this point in the history
…72126)

#71318 failed to clear EVEX512 feature for intended intrinsics.

Fixes #72106
  • Loading branch information
phoebewang committed Nov 14, 2023
1 parent 4574fe9 commit 451c594
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
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;
}

0 comments on commit 451c594

Please sign in to comment.