https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/72126
failed to clear EVEX512 feature for intended intrinsics. Fixes #72106 >From a7642c3216cac9901f2e8b2290732ad526406b06 Mon Sep 17 00:00:00 2001 From: Phoebe Wang <phoebe.w...@intel.com> Date: Mon, 13 Nov 2023 23:21:35 +0800 Subject: [PATCH] [X86][AVX10] Fix a bug when using -march with no-evex512 attribute failed to clear EVEX512 feature for intended intrinsics. Fixes #72106 --- clang/lib/Basic/Targets/X86.cpp | 2 +- clang/test/CodeGen/X86/pr72106.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 clang/test/CodeGen/X86/pr72106.c diff --git a/clang/lib/Basic/Targets/X86.cpp b/clang/lib/Basic/Targets/X86.cpp index eb127a8a11fffd5..acde3c1661748f0 100644 --- a/clang/lib/Basic/Targets/X86.cpp +++ b/clang/lib/Basic/Targets/X86.cpp @@ -122,7 +122,7 @@ bool X86TargetInfo::initFeatureMap( std::vector<std::string> UpdatedAVX10FeaturesVec; enum { FE_NOSET = -1, FE_FALSE, FE_TRUE }; int HasEVEX512 = FE_NOSET; - bool HasAVX512F = false; + bool HasAVX512F = Features["avx512f"]; bool HasAVX10 = false; bool HasAVX10_512 = false; std::string LastAVX10; diff --git a/clang/test/CodeGen/X86/pr72106.c b/clang/test/CodeGen/X86/pr72106.c new file mode 100644 index 000000000000000..7ff4012f319b5b1 --- /dev/null +++ b/clang/test/CodeGen/X86/pr72106.c @@ -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; +} _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits