[clang] [X86] Add constexpr handling for XOP/AVX512 rotate by immediate intrinsics (PR #156047)

2025-08-29 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/156047 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [x86][AVX-VNNI] Fix VPDPBUSD Argument Types (PR #155194)

2025-08-28 Thread Phoebe Wang via cfe-commits
@@ -4148,6 +4148,34 @@ static Value *upgradeX86IntrinsicCall(StringRef Name, CallBase *CI, Function *F, Value *Args[] = {CI->getArgOperand(0), CI->getArgOperand(1), CI->getArgOperand(2)}; + +// Input arguments types were incorrectly set to vectors

[clang] [Headers][X86] Allow AVX512VLBW integer reduction intrinsics to be used in constexpr (PR #155199)

2025-08-26 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/155199 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers][X86] Update FMA3/FMA4 scalar intrinsics to use __builtin_elementwise_fma and support constexpr (PR #154731)

2025-08-25 Thread Phoebe Wang via cfe-commits
@@ -40,16 +40,16 @@ _mm_macc_pd(__m128d __A, __m128d __B, __m128d __C) { (__v2df)__C); } -static __inline__ __m128 __DEFAULT_FN_ATTRS128 +static __inline__ __m128 __DEFAULT_FN_ATTRS128_CONSTEXPR _mm_macc_ss(__m128 __A, __m128 __B, _

[clang] [Headers][X86] Use `__builtin_elementwise_ctlz` instead of avx512cd intrinsics. (PR #155089)

2025-08-25 Thread Phoebe Wang via cfe-commits
phoebewang wrote: > > Convert _mm_lzcnt_epi32 etc. (inc mask/maskz variants) to use > > __builtin_elementwise_ctlz > > It's not obvious to me how the mask/maskz variants (e.g. > `_mm_maskz_lzcnt_epi32`) can be refactored to use > `__builtin_elementwise_ctlz`. > > Is it enough to replace this

[clang] [Headers][X86] Use `__builtin_elementwise_ctlz` instead of avx512cd intrinsics. (PR #155089)

2025-08-25 Thread Phoebe Wang via cfe-commits
@@ -42,35 +43,41 @@ __m512i test_mm512_maskz_conflict_epi32(__mmask16 __U, __m512i __A) { } __m512i test_mm512_lzcnt_epi32(__m512i __A) { // CHECK-LABEL: test_mm512_lzcnt_epi32 - // CHECK: call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> %{{.*}}, i1 false) + // CHECK: call <16

[clang] [clang][x86] Add release note entries describing recent work to making SSE intrinsics generic and usable with constexpr (PR #154737)

2025-08-21 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/154737 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][X86] Replace F16C `vcvtph2ps/256` intrinsics with `(convert|shuffle)vector` builtins (PR #152911)

2025-08-20 Thread Phoebe Wang via cfe-commits
phoebewang wrote: We don't guarantee builtins compatibility. You should use intrinsic `_mm256_mask_cvtph_ps` instead. Please taking care of the difference in arguments order. https://github.com/llvm/llvm-project/pull/152911 ___ cfe-commits mailing li

[clang] [Headers][X86] Allow FMA3/FMA4 vector intrinsics to be used in constexpr (PR #154558)

2025-08-20 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/154558 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers][X86] Enable constexpr handling for pmulhw/pmulhuw avx512 mask/maskz intrinsics (PR #154341)

2025-08-19 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/154341 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][X86] Add avx512 __builtin_ia32_select* constexpr handling (PR #152705)

2025-08-18 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/152705 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers][X86] Allow pmuludq/pmuldq to be used in constexpr (PR #153293)

2025-08-16 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/153293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers][X86] Allow pmuludq/pmuldq to be used in constexpr (PR #153293)

2025-08-15 Thread Phoebe Wang via cfe-commits
@@ -389,6 +389,7 @@ __m64 test_mm_mul_su32(__m64 a, __m64 b) { // CHECK: mul <2 x i64> %{{.*}}, %{{.*}} return _mm_mul_su32(a, b); } +TEST_CONSTEXPR(match_m64(_mm_mul_su32((__m64)(__v4hi){+1, -2, +3, -4}, (__m64)(__v4hi){-10, +8, +6, -4}), 2533154533212150)); -

[clang] [llvm] [X86][APX] Remove CF feature from APXF and Diamond Rapids (PR #153751)

2025-08-15 Thread Phoebe Wang via cfe-commits
phoebewang wrote: > "CF" is a hardware feature; it's incredibly confusing to just pretend it > doesn't exist because it's slow. If you need to adjust codegen, add a > separate feature TuningSlowCF or something. Although it's a hardware feature, it's fully under software control due to it's au

[clang] [Headers][X86] Remove more duplicated typedefs (PR #153820)

2025-08-15 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/153820 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers][X86] Allow pmuludq/pmuldq to be used in constexpr (PR #153293)

2025-08-15 Thread Phoebe Wang via cfe-commits
@@ -389,6 +389,7 @@ __m64 test_mm_mul_su32(__m64 a, __m64 b) { // CHECK: mul <2 x i64> %{{.*}}, %{{.*}} return _mm_mul_su32(a, b); } +TEST_CONSTEXPR(match_m64(_mm_mul_su32((__m64)(__v4hi){+1, -2, +3, -4}, (__m64)(__v4hi){-10, +8, +6, -4}), 2533154533212150)); -

[clang] [Headers][X86] Allow pmuludq/pmuldq to be used in constexpr (PR #153293)

2025-08-15 Thread Phoebe Wang via cfe-commits
@@ -344,6 +344,7 @@ __m128i test_mm_mul_epi32(__m128i x, __m128i y) { // CHECK: mul <2 x i64> %{{.*}}, %{{.*}} return _mm_mul_epi32(x, y); } +TEST_CONSTEXPR(match_m128i(_mm_mul_epi32((__m128i)(__v8hi){+1, -2, +3, -4, +5, -6, +7, -8}, (__m128i)(__v8hi){-16, -14, +12, +10, -

[clang] [Headers][X86] Allow pmuludq/pmuldq to be used in constexpr (PR #153293)

2025-08-15 Thread Phoebe Wang via cfe-commits
@@ -925,6 +925,7 @@ __m128i test_mm_mul_epu32(__m128i A, __m128i B) { // CHECK: mul <2 x i64> %{{.*}}, %{{.*}} return _mm_mul_epu32(A, B); } +TEST_CONSTEXPR(match_m128i(_mm_mul_epu32((__m128i)(__v8hi){+1, -2, +3, -4, +5, -6, +7, -8}, (__m128i)(__v8hi){-16, -14, +12, +10, -

[clang] [Headers][X86] Allow pmuludq/pmuldq to be used in constexpr (PR #153293)

2025-08-15 Thread Phoebe Wang via cfe-commits
@@ -389,6 +389,7 @@ __m64 test_mm_mul_su32(__m64 a, __m64 b) { // CHECK: mul <2 x i64> %{{.*}}, %{{.*}} return _mm_mul_su32(a, b); } +TEST_CONSTEXPR(match_m64(_mm_mul_su32((__m64)(__v4hi){+1, -2, +3, -4}, (__m64)(__v4hi){-10, +8, +6, -4}), 2533154533212150)); -

[clang] [Headers][X86] Remove more duplicated typedefs (PR #153820)

2025-08-15 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/153820 They are defined in mmintrin.h >From 56358bd19058486ed7b4e19c43255199ffb1ccd0 Mon Sep 17 00:00:00 2001 From: "Wang, Phoebe" Date: Fri, 15 Aug 2025 23:33:23 +0800 Subject: [PATCH] [Headers][X86] Remove more d

[clang] [Headers][X86] Remove duplicate __v8hu, NFCI (PR #153734)

2025-08-15 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/153734 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86][APX] Remove CF feature from APXF and Diamond Rapids (PR #153751)

2025-08-14 Thread Phoebe Wang via cfe-commits
phoebewang wrote: > Update description? > > Due to it results in more losses than gains. -> Due to it results in more > losses than gains w/o HWPGO. I assume HWPGO is not mature enough. https://github.com/llvm/llvm-project/pull/153751 ___ cfe-commit

[clang] [llvm] [X86][APX] Remove CF feature from APXF and Diamond Rapids (PR #153751)

2025-08-14 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/153751 Due to it results in more losses than gains. >From 155a039f02a9dcabeae70ac4ff9438bdc3357d41 Mon Sep 17 00:00:00 2001 From: "Wang, Phoebe" Date: Fri, 15 Aug 2025 14:18:20 +0800 Subject: [PATCH] [X86][APX] Rem

[clang] [Headers][X86] Remove duplicate __v8hu, NFCI (PR #153734)

2025-08-14 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/153734 Newly added in xmmintrin.h by c8312bdd1665225c585dd2b0bff5e46d569edd45 >From 40265a5b25d3bed04e99532b7202945f08c95dd8 Mon Sep 17 00:00:00 2001 From: "Wang, Phoebe" Date: Fri, 15 Aug 2025 11:28:07 +0800 Subje

[clang] [Clang] Honor -flax-vector-conversions=none on some tests (PR #153433)

2025-08-14 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/153433 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Honor -flax-vector-conversions=none on some tests (PR #153433)

2025-08-13 Thread Phoebe Wang via cfe-commits
@@ -1,11 +1,11 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - +// RUN: %clang_cc1 %s -emit-llvm -flax-vector-conversions=none -o - typedef float __m128 __attribute__((__vector_size__(16))); typedef long long __v2di __attribute__((__vector_size__(16))); typedef int __v4si __attrib

[clang] [Clang] Honor -flax-vector-conversions=none on some tests (PR #153433)

2025-08-13 Thread Phoebe Wang via cfe-commits
@@ -1,16 +1,16 @@ // REQUIRES: x86-registered-target -// RUN: %clang_cc1 %s -triple=i686-apple-darwin -target-feature +ssse3 -O1 -S -o - | FileCheck %s +// RUN: %clang_cc1 %s -triple=i686-apple-darwin -target-feature +ssse3 -O1 -S -flax-vector-conversions=none -o - | FileCheck

[clang] [Clang] Honor -flax-vector-conversions=none on some tests (PR #153433)

2025-08-13 Thread Phoebe Wang via cfe-commits
@@ -56,11 +56,6 @@ namespace Vector { static_assert(__builtin_vectorelements(v2) == (32 / sizeof(double)), ""); } -namespace { - typedef float __attribute__((vector_size(16))) VI42; - constexpr VI42 A2 = A; phoebewang wrote: Can we change it to `A2 = {1.f

[clang] [Headers][X86] Allow SSE41/AVX2/AVX512F/AVX512BW integer extension intrinsics to be used in constexpr (PR #152971)

2025-08-11 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/152971 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][X86] Replace F16C `vcvtph2ps/256` intrinsics with `(convert|shuffle)vector` builtins (PR #152911)

2025-08-10 Thread Phoebe Wang via cfe-commits
@@ -40,12 +40,17 @@ typedef signed char __v16qs __attribute__((__vector_size__(16))); #ifdef __SSE2__ /* Both _Float16 and __bf16 require SSE2 being enabled. */ +typedef _Float16 __v4hf __attribute__((__vector_size__(8))); typedef _Float16 __v8hf __attribute__((__vector_size

[clang] [Headers][X86] Allow BITALG vpopcntw/vpopcntb intrinsics to be used in constexpr (PR #152701)

2025-08-08 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/152701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][X86] Replace unnecessary `vfmadd*` builtins with `element_wise_fma` (PR #152545)

2025-08-08 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/152545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers][X86] Enable constexpr handling for pmulhw/pmulhuw intrinsics (PR #152540)

2025-08-07 Thread Phoebe Wang via cfe-commits
@@ -940,18 +940,21 @@ __m128i test_mm_mulhi_epi16(__m128i A, __m128i B) { // CHECK: call <8 x i16> @llvm.x86.sse2.pmulh.w(<8 x i16> %{{.*}}, <8 x i16> %{{.*}}) return _mm_mulhi_epi16(A, B); } +TEST_CONSTEXPR(match_v8hi(_mm_mulhi_epi16((__m128i)(__v8hi){+1, -2, +3, -4, +5,

[clang] [Headers][X86] Enable constexpr handling for pmulhw/pmulhuw intrinsics (PR #152540)

2025-08-07 Thread Phoebe Wang via cfe-commits
@@ -365,12 +365,14 @@ __m64 test_mm_mulhi_pi16(__m64 a, __m64 b) { // CHECK: call <8 x i16> @llvm.x86.sse2.pmulh.w( return _mm_mulhi_pi16(a, b); } +TEST_CONSTEXPR(match_v4hi(_mm_mulhi_pi16((__m64)(__v4hi){+1, -2, +3, -4}, (__m64)(__v4hi){-10, +8, +6, -4}), -1, -1, 0, 0));

[clang] [Headers][X86] Enable constexpr handling for pmulhw/pmulhuw intrinsics (PR #152540)

2025-08-07 Thread Phoebe Wang via cfe-commits
@@ -11653,6 +11659,18 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) { APSInt(LHS.isSigned() ? LHS.ssub_sat(RHS) : LHS.usub_sat(RHS), DestEltTy->isUnsignedIntegerOrEnumerationType(; break; + case clang::X86::BI__bu

[clang] [Headers][X86] Update AVX/AVX512 float/double add/sub/mul/div/unpck intrinsics to be used in constexpr (PR #152435)

2025-08-06 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/152435 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers][X86] Update SSE/AVX and/andnot/or/xor intrinsics to be used in constexpr (PR #152305)

2025-08-06 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/152305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers][X86] Allow AVX _mm256_set* intrinsics to be used in constexpr (PR #152173)

2025-08-06 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/152173 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][seh]: Fix c++ destructors when c++ exceptions are disabled (PR #151836)

2025-08-02 Thread Phoebe Wang via cfe-commits
phoebewang wrote: Is the problem happening when enabling async-exceptions but not cxx-exceptions on c++ objects? I'm not sure if it's a valid scenario. The designed requires `cxx-exceptions`, see descriptions in https://github.com/llvm/llvm-project/commit/797ad701522988e212495285dade8efac41a24

[clang] [X86][AVX10.2] Fix VNNIINT16 maskz intrinsics arguments order (PR #151077)

2025-07-28 Thread Phoebe Wang via cfe-commits
phoebewang wrote: /cherry-pick https://github.com/llvm/llvm-project/commit/3ea3e334cc19cdd34416b546ac4b4a24b2018a28 https://github.com/llvm/llvm-project/pull/151077 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [X86][AVX10.2] Fix VNNIINT16 maskz intrinsics arguments order (PR #151077)

2025-07-28 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang milestoned https://github.com/llvm/llvm-project/pull/151077 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86][AVX10.2] Fix VNNIINT16 maskz intrinsics arguments order (PR #151077)

2025-07-28 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/151077 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86][AVX10.2] Fix VNNIINT16 maskz intrinsics arguments order (PR #151077)

2025-07-28 Thread Phoebe Wang via cfe-commits
phoebewang wrote: The change needs a release note update, but I want to backport it to LLVM21 release. Would update LLVM21 release note instead. https://github.com/llvm/llvm-project/pull/151077 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang] [X86][AVX10.2] Fix VNNIINT16 maskz intrinsics arguments order (PR #151077)

2025-07-28 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/151077 For maskz intrinsics, the first argument is always the mask. >From f175aa9a54b8fb6e3be91af0ae38e553a4d4852d Mon Sep 17 00:00:00 2001 From: "Wang, Phoebe" Date: Tue, 29 Jul 2025 10:59:38 +0800 Subject: [PATCH

[clang] [clang] [Sema] Check argument range for prefetchi* intrinsics (PR #149745)

2025-07-23 Thread Phoebe Wang via cfe-commits
phoebewang wrote: > This requires a release note, especially because it fixes a bug. We don't change the intrinsic behavior and bug fixes usually don't need a release note. It's only needed when backporting to release branch. https://github.com/llvm/llvm-project/pull/149745 ___

[clang] [clang] [Sema] Check argument range for prefetchi* intrinsics (PR #149745)

2025-07-22 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/149745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [Sema] Check argument range for prefetchi* intrinsics (PR #149745)

2025-07-22 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. https://github.com/llvm/llvm-project/pull/149745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [Sema] Check argument range for prefetchi* intrinsics (PR #149745)

2025-07-21 Thread Phoebe Wang via cfe-commits
@@ -0,0 +1,11 @@ +// RUN: %clang_cc1 %s -ffreestanding -triple=i686-unknown-unknown -target-feature +sm3 -fsyntax-only -verify + +#include + +__m128i test_mm_sm3rnds2_epi32(__m128i __A, __m128i __B, __m128i __C) { + return _mm_sm3rnds2_epi32(__A, __B, __C, 256); // expected-er

[clang] [clang] [Sema] Check argument range for prefetchi* intrinsics (PR #149745)

2025-07-21 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang requested changes to this pull request. Please check test failures. https://github.com/llvm/llvm-project/pull/149745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [clang] [Sema] Check argument range for prefetchi* intrinsics (PR #149745)

2025-07-21 Thread Phoebe Wang via cfe-commits
@@ -14,3 +14,7 @@ void test_m_prefetch_it1(void *p) { // CHECK-LABEL: define{{.*}} void @test_m_prefetch_it1 // CHECK: call void @llvm.prefetch.p0(ptr {{.*}}, i32 0, i32 2, i32 0) } + +void test_invalid_prefetchi(void* p) { + return __builtin_ia32_prefetchi(p, 1); // expec

[clang] [clang] [Sema] Check argument range for prefetchi* intrinsics (PR #149745)

2025-07-21 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang edited https://github.com/llvm/llvm-project/pull/149745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [Sema] Check argument range for prefetchi* intrinsics (PR #149745)

2025-07-21 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/149745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [Sema] Check argument range for prefetchi* intrinsics (PR #149745)

2025-07-20 Thread Phoebe Wang via cfe-commits
phoebewang wrote: Thanks for the patch! You can add a test case for it like `clang/test/CodeGen/X86/sm3-error.c` https://github.com/llvm/llvm-project/pull/149745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [llvm] [X86] Remove WIDEKL feature from Pantherlake and Clearwaterforest (PR #148184)

2025-07-18 Thread Phoebe Wang via cfe-commits
@@ -176,10 +176,10 @@ constexpr FeatureBitset FeaturesArrowlakeS = FeaturesArrowlake | FeatureAVXVNNIINT16 | FeatureSHA512 | FeatureSM3 | FeatureSM4; constexpr FeatureBitset FeaturesPantherlake = -FeaturesArrowlakeS | FeaturePREFETCHI; +FeaturesArrowlakeS ^ Feat

[clang] [NFC][Clang][FMV] Refactor sema checking of target_version/clones attributes. (PR #149067)

2025-07-16 Thread Phoebe Wang via cfe-commits
@@ -1056,4 +1056,62 @@ void SemaX86::handleForceAlignArgPointerAttr(Decl *D, const ParsedAttr &AL) { X86ForceAlignArgPointerAttr(getASTContext(), AL)); } +enum FirstParam { Unsupported, Duplicate, Unknown }; +enum SecondParam { None, CPU, Tune }; +enum ThirdP

[clang] [llvm] [X86][AVX10.2] Decouple AMX-AVX512 from AVX10.2 (PR #148633)

2025-07-14 Thread Phoebe Wang via cfe-commits
phoebewang wrote: > TBH I'm not sure if we need to add `avx512f,evex512` to intrinsics attributes > and/or to `.td` as well. Yes, we need them for now. Otherwise, we cannot allocate ZMM registers. https://github.com/llvm/llvm-project/pull/148633 ___

[clang] [llvm] [X86][AVX10.2] Decouple AMX-AVX512 from AVX10.2 (PR #148633)

2025-07-14 Thread Phoebe Wang via cfe-commits
@@ -16,7 +16,15 @@ #define __DEFAULT_FN_ATTRS_AVX512 \ __attribute__((__always_inline__, __nodebug__, \ - __target__("amx-avx512,avx10.2-512"))) + __target__("amx-avx

[clang] [llvm] [X86] Remove WIDEKL feature from Pantherlake and Clearwaterforest (PR #148184)

2025-07-11 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/148184 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86] Remove WIDEKL feature from Pantherlake and Clearwaterforest (PR #148184)

2025-07-11 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/148184 According to Intel [SDM088](https://cdrdv2.intel.com/v1/dl/getContent/671200) Volume 1, Chapter 2.4, Key Locker will be removed from 2025 onwards products. >From 9a8224c22535912a1fa95caa41f8fc2c3f7a76d0 Mon

[clang] [llvm] [X86] Remove CLDEMOTE from Arrowlake and later hybrid processors (PR #144833)

2025-06-19 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/144833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86] Remove CLDEMOTE from Arrowlake and later hybrid processors (PR #144833)

2025-06-18 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang updated https://github.com/llvm/llvm-project/pull/144833 >From 8e218d9c4431b021231942e514f175164af35a51 Mon Sep 17 00:00:00 2001 From: "Wang, Phoebe" Date: Thu, 19 Jun 2025 12:14:54 +0800 Subject: [PATCH 1/2] [X86] Remove CLDEMOTE from Arrowlake and later hybrid p

[clang] [llvm] [X86] Remove CLDEMOTE from Arrowlake and later hybrid processors (PR #144833)

2025-06-18 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/144833 Decouple Arrowlake from Sierraforest because the later has CLDEMOTE feature. >From 8e218d9c4431b021231942e514f175164af35a51 Mon Sep 17 00:00:00 2001 From: "Wang, Phoebe" Date: Thu, 19 Jun 2025 12:14:54 +0800

[clang] [llvm] [X86] Remove CLDEMOTE from Alderlake and later hybrid processors (PR #144662)

2025-06-18 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/144662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86] Remove CLDEMOTE from Alderlake and later hybrid processors (PR #144662)

2025-06-18 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/144662 SDM doesn't list any hybrid processors in this feature. Besides, physical machine also reports not supported. >From 353fbfc93faa2c1bad26261b566d3f797b6d1a72 Mon Sep 17 00:00:00 2001 From: "Wang, Phoebe" Dat

[clang] [Driver][X86] Fix LIT test failure on Solaris OS + AMD64 CPU. (PR #141486)

2025-05-26 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/141486 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (#115099)" (PR #138360)

2025-05-03 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang commented: The pre-checkin failures seem related. https://github.com/llvm/llvm-project/pull/138360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (#115099)" (PR #138360)

2025-05-03 Thread Phoebe Wang via cfe-commits
@@ -138,6 +138,12 @@ let Attributes = [Const, NoThrow, RequiredVectorWidth<256>], Features = "avx" in } } +// PRFCHW +let Features = "prfchw", Header = "intrin.h", Attributes = [NoThrow, Const] in { phoebewang wrote: Although they are in the same file, bo

[clang] Reapply "[Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (#115099)" (PR #138360)

2025-05-03 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang edited https://github.com/llvm/llvm-project/pull/138360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] [X86][APX] Suppress EGPR/NDD instructions for relocations (PR #136660)

2025-04-29 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/136660 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] [X86][APX] Suppress EGPR/NDD instructions for relocations (PR #136660)

2025-04-28 Thread Phoebe Wang via cfe-commits
@@ -0,0 +1,236 @@ +//===- X86SuppressAPXForReloc.cpp - Suppress APX features for relocations -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [lld] [llvm] [X86][APX] Suppress EGPR/NDD instructions for relocations (PR #136660)

2025-04-28 Thread Phoebe Wang via cfe-commits
@@ -0,0 +1,236 @@ +//===- X86SuppressAPXForReloc.cpp - Suppress APX features for relocations -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [lld] [llvm] [X86][APX] Suppress EGPR/NDD instructions for relocations (PR #136660)

2025-04-28 Thread Phoebe Wang via cfe-commits
@@ -0,0 +1,236 @@ +//===- X86SuppressAPXForReloc.cpp - Suppress APX features for relocations -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [lld] [llvm] [X86][APX] Suppress EGPR/NDD instructions for relocations (PR #136660)

2025-04-28 Thread Phoebe Wang via cfe-commits
@@ -254,11 +256,20 @@ static bool CompressEVEXImpl(MachineInstr &MI, const X86Subtarget &ST) { } } + bool IsWithReloc = false; + if (X86EnableAPXForRelocation) { +int MemOpNo = X86II::getMemoryOperandNo(MI.getDesc().TSFlags) + + X86II::getOperandB

[clang] [lld] [llvm] [X86][APX] Suppress EGPR/NDD instructions for relocations (PR #136660)

2025-04-28 Thread Phoebe Wang via cfe-commits
phoebewang wrote: > This solution can not handle post-RA optimizations. Could we implement it in > MC stage for this workaround? We cannot change the register after RA. I don't see any problem for now expect NF optimizations, which we can skip them for now. https://github.com/llvm/llvm-projec

[clang] [lld] [llvm] [X86][APX] Suppress EGPR/NDD instructions for relocations (PR #136660)

2025-04-28 Thread Phoebe Wang via cfe-commits
@@ -127,6 +127,7 @@ ; CHECK-NEXT: X86 LEA Optimize ; CHECK-NEXT: X86 Optimize Call Frame ; CHECK-NEXT: X86 Avoid Store Forwarding Block +; CHECK-NEXT: X86 Suppress APX features for relocation phoebewang wrote: Ok, we don't need to move

[clang] [lld] [llvm] [X86][APX] Suppress EGPR/NDD instructions for relocations (PR #136660)

2025-04-28 Thread Phoebe Wang via cfe-commits
@@ -242,8 +244,18 @@ static EFLAGSClobber getClobberType(const MachineInstr &MI) { MI.findRegisterDefOperand(X86::EFLAGS, /*TRI=*/nullptr); if (!FlagDef) return NoClobber; - if (FlagDef->isDead() && X86::getNFVariant(MI.getOpcode())) + + if (FlagDef->isDead() &&

[clang] [llvm] [X86][AVX512FP16] Decouple AVX512VL and AVX512DQ from AVX512FP16 (PR #137450)

2025-04-26 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/137450 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] [X86] Implement disabling APX relocations and EPGR/NDD instrs for relocations (PR #136660)

2025-04-25 Thread Phoebe Wang via cfe-commits
phoebewang wrote: > > Any comments? > > Still not understand the requirement... I'm confused by the test cases too. I understood the code as we replace the EGPR or NDD instructions with non-APX ones, which meets my expection. But the option and tests are in MC phase, which means instructions

[clang] [lld] [llvm] [X86] Implement disabling APX relocations and EPGR/NDD instrs for relocations (PR #136660)

2025-04-25 Thread Phoebe Wang via cfe-commits
@@ -0,0 +1,173 @@ +//===- X86SuppressAPXForReloc.cpp - Suppress APX features for relocations -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [lld] [llvm] [X86] Implement disabling APX relocations and EPGR/NDD instrs for relocations (PR #136660)

2025-04-25 Thread Phoebe Wang via cfe-commits
@@ -0,0 +1,173 @@ +//===- X86SuppressAPXForReloc.cpp - Suppress APX features for relocations -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [lld] [llvm] [X86] Implement disabling APX relocations and EPGR/NDD instrs for relocations (PR #136660)

2025-04-25 Thread Phoebe Wang via cfe-commits
@@ -0,0 +1,173 @@ +//===- X86SuppressAPXForReloc.cpp - Suppress APX features for relocations -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [lld] [llvm] [X86] Implement disabling APX relocations and EPGR/NDD instrs for relocations (PR #136660)

2025-04-25 Thread Phoebe Wang via cfe-commits
@@ -1,44 +1,84 @@ // REQUIRES: x86 -// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o +// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o -x86-apx-relax-relocations=true // RUN: ld.lld %t.o -o %t1 // RUN: llvm-readobj -r %t1 | FileCheck -

[clang] [lld] [llvm] [X86] Implement disabling APX relocations and EPGR/NDD instrs for relocations (PR #136660)

2025-04-25 Thread Phoebe Wang via cfe-commits
@@ -912,9 +912,9 @@ void X86_64::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const { case R_X86_64_CODE_4_GOTPC32_TLSDESC: case R_X86_64_TLSDESC_CALL: case R_X86_64_TLSGD: -if (rel.expr == R_RELAX_TLS_GD_TO_LE) { +if (rel.expr == R_RELAX_TLS_GD_TO

[clang] [lld] [llvm] [X86] Implement disabling APX relocations and EPGR/NDD instrs for relocations (PR #136660)

2025-04-25 Thread Phoebe Wang via cfe-commits
@@ -0,0 +1,173 @@ +//===- X86SuppressAPXForReloc.cpp - Suppress APX features for relocations -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [lld] [llvm] [X86] Implement disabling APX relocations and EPGR/NDD instrs for relocations (PR #136660)

2025-04-25 Thread Phoebe Wang via cfe-commits
@@ -89,6 +89,7 @@ set(sources GISel/X86InstructionSelector.cpp GISel/X86LegalizerInfo.cpp GISel/X86RegisterBankInfo.cpp + X86SuppressAPXForReloc.cpp phoebewang wrote: Put it in alphabetic order? https://github.com/llvm/llvm-project/pull/136660

[clang] [lld] [llvm] [X86] Implement disabling APX relocations and EPGR/NDD instrs for relocations (PR #136660)

2025-04-25 Thread Phoebe Wang via cfe-commits
@@ -912,9 +912,9 @@ void X86_64::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const { case R_X86_64_CODE_4_GOTPC32_TLSDESC: case R_X86_64_TLSDESC_CALL: case R_X86_64_TLSGD: -if (rel.expr == R_RELAX_TLS_GD_TO_LE) { +if (rel.expr == R_RELAX_TLS_GD_TO

[clang] [lld] [llvm] [X86] Implement disabling APX relocations and EPGR/NDD instrs for relocations (PR #136660)

2025-04-25 Thread Phoebe Wang via cfe-commits
@@ -1,44 +1,84 @@ // REQUIRES: x86 -// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o +// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o -x86-apx-relax-relocations=true // RUN: ld.lld %t.o -o %t1 // RUN: llvm-readobj -r %t1 | FileCheck -

[clang] [llvm] [X86][AVX10] Remove VAES and VPCLMULQDQ feature from AVX10.1 (PR #135489)

2025-04-15 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/135489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86][AVX10] Remove VAES and VPCLMULQDQ feature from AVX10.1 (PR #135489)

2025-04-13 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang milestoned https://github.com/llvm/llvm-project/pull/135489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86][AVX10] Remove VAES and VPCLMULQDQ feature from AVX10.1 (PR #135489)

2025-04-13 Thread Phoebe Wang via cfe-commits
phoebewang wrote: /cherry-pick https://github.com/llvm/llvm-project/commit/ebba554a3211b0b98d3ae33ba70f9d6ceaab6ad4 https://github.com/llvm/llvm-project/pull/135489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [llvm] [X86][AVX10] Remove VAES and VPCLMULQDQ feature from AVX10.1 (PR #135489)

2025-04-12 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/135489 According to SDM, they require both VAES/VPCLMULQDQ and AVX10.1 CPUID bits. Fixes: #135394 >From f6c06c613a8b862307e643edb8f010cf2f666350 Mon Sep 17 00:00:00 2001 From: "Wang, Phoebe" Date: Sat, 12 Apr 2025

[clang] [X86][AVX10] Make warning message more informative, NFCI (PR #134528)

2025-04-06 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/134528 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86][AVX10] Make warning message more informative, NFCI (PR #134528)

2025-04-06 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/134528 None >From 04852072c016e6df3c9b6d834ba34c443593aa04 Mon Sep 17 00:00:00 2001 From: "Wang, Phoebe" Date: Sun, 6 Apr 2025 18:22:22 +0800 Subject: [PATCH] [X86][AVX10] Make warning message more informative, NFC

[clang] [X86][AVX10.2] Use 's_' for saturate-convert intrinsics (PR #131592)

2025-04-05 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang edited https://github.com/llvm/llvm-project/pull/131592 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [X86][AVX10.2] Remove YMM rounding from VCVT2PS2PHX (PR #132397)

2025-04-05 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/132397 Ref: https://cdrdv2.intel.com/v1/dl/getContent/784343 >From a8353b285f99b57a3d4ce28add512debc8761d5a Mon Sep 17 00:00:00 2001 From: "Wang, Phoebe" Date: Fri, 21 Mar 2025 20:54:06 +0800 Subject: [PATCH] [X86]

[clang] [llvm] [X86][AVX10.2] Remove YMM rounding from VCVTTP.*QS (PR #132414)

2025-04-05 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/132414 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86][AMX] Add missing __inline__ for AMXCOMPLEX intrinsics, NFCI (PR #134484)

2025-04-05 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/134484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86][AMX] Add missing __inline__ for AMXCOMPLEX intrinsics, NFCI (PR #134484)

2025-04-05 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang created https://github.com/llvm/llvm-project/pull/134484 Found by #64779. >From b04e443d3569ec2ed352e127bf6fbfe0902b1ee1 Mon Sep 17 00:00:00 2001 From: "Wang, Phoebe" Date: Sat, 5 Apr 2025 15:03:17 +0800 Subject: [PATCH] [X86][AMX] Add missing __inline__ for AMXCO

[clang] [llvm] [X86][AVX10.2] Remove YMM rounding from VCVT2PS2PHX (PR #132397)

2025-04-04 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/132397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86][AVX10.2] Replace nepbh with bf16 to match with others, NFCI (PR #134240)

2025-04-03 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang closed https://github.com/llvm/llvm-project/pull/134240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   6   7   8   9   10   >