[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

2025-05-29 Thread Simon Pilgrim via cfe-commits
@@ -3483,6 +3487,127 @@ bool VectorCombine::foldInterleaveIntrinsics(Instruction &I) { return true; } +// Attempt to shrink loads that are only used by shufflevector instructions. +bool VectorCombine::shrinkLoadForShuffles(Instruction &I) { + auto *OldLoad = dyn_cast(&I);

[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

2025-05-29 Thread Simon Pilgrim via cfe-commits
@@ -3483,6 +3487,127 @@ bool VectorCombine::foldInterleaveIntrinsics(Instruction &I) { return true; } +// Attempt to shrink loads that are only used by shufflevector instructions. +bool VectorCombine::shrinkLoadForShuffles(Instruction &I) { + auto *OldLoad = dyn_cast(&I);

[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

2025-05-29 Thread Simon Pilgrim via cfe-commits
@@ -3483,6 +3487,127 @@ bool VectorCombine::foldInterleaveIntrinsics(Instruction &I) { return true; } +// Attempt to shrink loads that are only used by shufflevector instructions. +bool VectorCombine::shrinkLoadForShuffles(Instruction &I) { + auto *OldLoad = dyn_cast(&I);

[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

2025-05-29 Thread Simon Pilgrim via cfe-commits
@@ -3483,6 +3487,127 @@ bool VectorCombine::foldInterleaveIntrinsics(Instruction &I) { return true; } +// Attempt to shrink loads that are only used by shufflevector instructions. +bool VectorCombine::shrinkLoadForShuffles(Instruction &I) { + auto *OldLoad = dyn_cast(&I);

[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

2025-05-29 Thread Simon Pilgrim via cfe-commits
@@ -3483,6 +3487,127 @@ bool VectorCombine::foldInterleaveIntrinsics(Instruction &I) { return true; } +// Attempt to shrink loads that are only used by shufflevector instructions. +bool VectorCombine::shrinkLoadForShuffles(Instruction &I) { + auto *OldLoad = dyn_cast(&I);

[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

2025-05-29 Thread Simon Pilgrim via cfe-commits
@@ -3483,6 +3487,127 @@ bool VectorCombine::foldInterleaveIntrinsics(Instruction &I) { return true; } +// Attempt to shrink loads that are only used by shufflevector instructions. +bool VectorCombine::shrinkLoadForShuffles(Instruction &I) { + auto *OldLoad = dyn_cast(&I);

[clang] [flang] [Clang][Driver][fveclib] Fix target parsing for -fveclib=AMDLIBM option (PR #140544)

2025-05-20 Thread Simon Pilgrim via cfe-commits
RKSimon wrote: @rohitaggarwal007 please can you edit the summary to briefly describe the fix https://github.com/llvm/llvm-project/pull/140544 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] 4fa2c62 - Fix MSVC "not all control paths return a value" warning. NFC.

2025-05-20 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2025-05-20T14:18:56+01:00 New Revision: 4fa2c62e324afacf2788e60cc34bcfe7ee62d06d URL: https://github.com/llvm/llvm-project/commit/4fa2c62e324afacf2788e60cc34bcfe7ee62d06d DIFF: https://github.com/llvm/llvm-project/commit/4fa2c62e324afacf2788e60cc34bcfe7ee62d06d.diff

[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

2025-05-06 Thread Simon Pilgrim via cfe-commits
@@ -3483,6 +3487,131 @@ bool VectorCombine::foldInterleaveIntrinsics(Instruction &I) { return true; } +// Attempt to shrink loads that are only used by shufflevector instructions. +bool VectorCombine::shrinkLoadForShuffles(Instruction &I) { + auto *OldLoad = dyn_cast(&I);

[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

2025-05-06 Thread Simon Pilgrim via cfe-commits
@@ -3483,6 +3487,131 @@ bool VectorCombine::foldInterleaveIntrinsics(Instruction &I) { return true; } +// Attempt to shrink loads that are only used by shufflevector instructions. +bool VectorCombine::shrinkLoadForShuffles(Instruction &I) { + auto *OldLoad = dyn_cast(&I);

[clang] [llvm] [IRBuilder] Add versions of createInsertVector/createExtractVector that take a uint64_t index. (PR #138324)

2025-05-02 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/138324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [TableGen] Only store direct superclasses in Record (PR #123072)

2025-04-24 Thread Simon Pilgrim via cfe-commits
RKSimon wrote: @jayfoad reverse-ping - what's the plan for this please? https://github.com/llvm/llvm-project/pull/123072 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] ec40027 - Fix MSVC "not all control paths return a value" warning. NFCI.

2025-04-07 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2025-04-07T10:31:38+01:00 New Revision: ec400277c6810915a501fa901e9ba58ab6ade831 URL: https://github.com/llvm/llvm-project/commit/ec400277c6810915a501fa901e9ba58ab6ade831 DIFF: https://github.com/llvm/llvm-project/commit/ec400277c6810915a501fa901e9ba58ab6ade831.diff

[clang] [llvm] [X86][AVX10.2] Remove YMM rounding from VMINMAXP[H,S,D] (PR #132405)

2025-04-05 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/132405 ___ 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-05 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon commented: are we missing clang codegen tests for these? 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

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

2025-04-04 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM - cheers 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

[clang] [X86][AVX10] Re-target mavx10.1 and emit warning for mavx10.x-256/512 and m[no-]evex512 (PR #132542)

2025-04-01 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. https://github.com/llvm/llvm-project/pull/132542 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86][AVX10] Re-target mavx10.1 and emit warning for mavx10.x-256/512 and m[no-]evex512 (PR #132542)

2025-03-31 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM - but we need to add a full explanation to the clang/llvm release notes explaining the avx10 changes/deprecations (and future removal). https://github.com/llvm/llvm-project/pull/132542 ___ cf

[clang] f15924d - Fix MSVC "not all control paths return a value" warning. NFC.

2025-03-27 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2025-03-27T08:55:47Z New Revision: f15924d1d1310527d7d78e8c66655e6b94bc241b URL: https://github.com/llvm/llvm-project/commit/f15924d1d1310527d7d78e8c66655e6b94bc241b DIFF: https://github.com/llvm/llvm-project/commit/f15924d1d1310527d7d78e8c66655e6b94bc241b.diff LOG:

[clang] [llvm] [VectorCombine] Shrink loads used in shufflevector rebroadcasts (PR #128938)

2025-03-26 Thread Simon Pilgrim via cfe-commits
@@ -47,21 +47,12 @@ define <8 x i32> @concat_extract_subvectors_poison(<8 x i32> %x) { ; broadcast loads are free on AVX (and blends are much cheap than general 2-operand shuffles) define <4 x double> @blend_broadcasts_v4f64(ptr %p0, ptr %p1) { -; SSE-LABEL: define <4 x do

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

2025-03-24 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM 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] [llvm] Revert "[X86][AVX10.2] Support YMM rounding new instructions (#101825)" (PR #132362)

2025-03-24 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM - do we have to remove avx10-256 as well (and just use prefer vector width) or will that remain in some form? https://github.com/llvm/llvm-project/pull/132362 ___ cfe-commits mailing list cfe

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

2025-03-21 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM with the clang-format warning fix on the header https://github.com/llvm/llvm-project/pull/132414 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcibi (Branch Immediate) extension (PR #130779)

2025-03-18 Thread Simon Pilgrim via cfe-commits
@@ -825,6 +825,17 @@ struct RISCVOperand final : public MCParsedAsmOperand { VK == RISCVMCExpr::VK_RISCV_None; } + bool isSImm5NonZero() const { +if (!isImm()) + return false; +RISCVMCExpr::VariantKind VK = RISCVMCExpr::VK_RISCV_None; ---

[clang] [llvm] [polly] [DAG] shouldReduceLoadWidth - hasOneUse should check just the loaded value - not the chain (PR #128167)

2025-02-22 Thread Simon Pilgrim via cfe-commits
@@ -1817,7 +1817,7 @@ class TargetLoweringBase { EVT NewVT) const { RKSimon wrote: There's an implicit dependency that I'm still trying to track down. https://github.com/llvm/llvm-project/pull/128167

[clang] [X86] Allow using the lzcnt intrinsics for non-LZCNT targets (PR #128284)

2025-02-22 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/128284 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86] Allow using the lzcnt intrinsics for non-LZCNT targets (PR #128284)

2025-02-22 Thread Simon Pilgrim via cfe-commits
@@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -x c -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +lzcnt -emit-llvm -o - | FileCheck %s -// RUN: %clang_cc1 -x c++ -std=c++11 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +lzcnt -emit-llvm -o - | FileCheck %s

[clang] [llvm] [polly] [DAG] shouldReduceLoadWidth - hasOneUse should check just the loaded value - not the chain (PR #128167)

2025-02-21 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon updated https://github.com/llvm/llvm-project/pull/128167 >From e73c264d0937a11fd3b08ac18a6465c6826d31f1 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 21 Feb 2025 11:57:07 + Subject: [PATCH 1/4] [DAG] shouldReduceLoadWidth - hasOneUse check for just be f

[clang] [llvm] [polly] [DAG] shouldReduceLoadWidth - hasOneUse should check just the loaded value - not the chain (PR #128167)

2025-02-21 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon updated https://github.com/llvm/llvm-project/pull/128167 >From e73c264d0937a11fd3b08ac18a6465c6826d31f1 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 21 Feb 2025 11:57:07 + Subject: [PATCH 1/3] [DAG] shouldReduceLoadWidth - hasOneUse check for just be f

[clang] [X86] Add missing explicit conversion for AMXAVX512 and SHA (PR #127385)

2025-02-16 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/127385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2025-01-21 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon commented: LGTM - but we should have a frontend specialist approve https://github.com/llvm/llvm-project/pull/119423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [clang] Lower non-builtin sincos[f|l] calls to llvm.sincos.* when -fno-math-errno is set (PR #121763)

2025-01-20 Thread Simon Pilgrim via cfe-commits
RKSimon wrote: > @RKSimon do you know if there is a reason CodeGen AA is not enabled for x86? > > I'd otherwise be happy to approve this patch, lowering to the intrinsic seems > like the right thing to do. I don't remember any reason for alias analysis to not be enabled on x86 - @phoebewang @

[clang] [clang] Restrict use of scalar types in vector builtins (PR #119423)

2025-01-06 Thread Simon Pilgrim via cfe-commits
@@ -649,7 +649,9 @@ Unless specified otherwise operation(±0) = ±0 and operation(±infinity) = ±in The integer elementwise intrinsics, including ``__builtin_elementwise_popcount``, ``__builtin_elementwise_bitreverse``, ``__builtin_elementwise_add_sat``, -``__builtin_elementwis

[clang] [Clang] Add float type support to __builtin_reduce_add and __builtin_reduce_multipy (PR #120367)

2025-01-03 Thread Simon Pilgrim via cfe-commits
RKSimon wrote: > > fp reductions are a nightmare - every time I thought we were getting > > somewhere, something else fastmath related causes more headaches. > > @RKSimon should I not proceed with this PR? I was really hoping to use this > in HLSL as it makes implementing many of our runtime a

[clang] [Clang] Add float type support to __builtin_reduce_add and __builtin_reduce_multipy (PR #120367)

2025-01-03 Thread Simon Pilgrim via cfe-commits
RKSimon wrote: > @RKSimon It looks like you started this work with: > > 1. > [a23291b](https://github.com/llvm/llvm-project/commit/a23291b7db48670f7c57adcfb45877c826a97f22) > > 2. > [8a92c45](https://github.com/llvm/llvm-project/commit/8a92c45e07dc81c83ca3afda3971d98c512429d4) > > If

[clang] 6279d2e - AArch64ABIInfo::passAsAggregateType - don't directly dereference getAs<> result. NFC.

2024-12-31 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-12-31T14:34:14Z New Revision: 6279d2e0f33ed1aa686aace48da6ccf912ab4b28 URL: https://github.com/llvm/llvm-project/commit/6279d2e0f33ed1aa686aace48da6ccf912ab4b28 DIFF: https://github.com/llvm/llvm-project/commit/6279d2e0f33ed1aa686aace48da6ccf912ab4b28.diff LOG:

[clang] [X86][AVX10.2] Fix wrong mask bits in cvtpbf8_ph intrinsics (PR #120927)

2024-12-23 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. https://github.com/llvm/llvm-project/pull/120927 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in reduce min/max function. (PR #120866)

2024-12-22 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM - cheers https://github.com/llvm/llvm-project/pull/120866 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in reduce min/max function. (PR #120866)

2024-12-22 Thread Simon Pilgrim via cfe-commits
@@ -838,3 +838,18 @@ static_assert(__builtin_elementwise_sub_sat((1 << 31), 42) == (1 << 31)); static_assert(__builtin_elementwise_sub_sat(0U, 1U) == 0U); static_assert(__builtin_bit_cast(unsigned, __builtin_elementwise_sub_sat((vector4char){5, 4, 3, 2}, (vector4char){1, 1, 1,

[clang] [llvm] [X86] Add missing feature USERMSR to DiamondRapids (PR #120061)

2024-12-16 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. https://github.com/llvm/llvm-project/pull/120061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix sub-integer __builtin_elementwise_(add|sub)_sat (PR #119423)

2024-12-11 Thread Simon Pilgrim via cfe-commits
RKSimon wrote: I thought bitreverse/popcount are only supposed to work with unsigned types? https://github.com/llvm/llvm-project/pull/119423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [clang] constexpr built-in elementwise add_sat/sub_sat functions. (PR #119082)

2024-12-08 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM cheers https://github.com/llvm/llvm-project/pull/119082 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in elementwise add_sat/sub_sat functions. (PR #119082)

2024-12-08 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon edited https://github.com/llvm/llvm-project/pull/119082 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in elementwise add_sat/sub_sat functions. (PR #119082)

2024-12-08 Thread Simon Pilgrim via cfe-commits
@@ -822,3 +822,19 @@ static_assert(__builtin_elementwise_bitreverse(0x12345678) == 0x1E6A2C48); static_assert(__builtin_elementwise_bitreverse(0x0123456789ABCDEFULL) == 0xF7B3D591E6A2C480); static_assert(__builtin_bit_cast(unsigned, __builtin_elementwise_bitreverse((vector4ch

[clang] [clang] constexpr built-in elementwise add_sat/sub_sat functions. (PR #119082)

2024-12-08 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon edited https://github.com/llvm/llvm-project/pull/119082 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in elementwise add_sat function. (PR #119082)

2024-12-08 Thread Simon Pilgrim via cfe-commits
@@ -11339,6 +11339,31 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) { return Success(APValue(ResultElements.data(), ResultElements.size()), E); } + case Builtin::BI__builtin_elementwise_add_sat: { +APValue SourceLHS, SourceRHS; +if (!EvaluateAsR

[clang] [clang] constexpr built-in elementwise bitreverse function. (PR #118177)

2024-12-02 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM - cheers https://github.com/llvm/llvm-project/pull/118177 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in elementwise bitreverse function. (PR #118177)

2024-12-02 Thread Simon Pilgrim via cfe-commits
@@ -11322,9 +11323,18 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) { for (unsigned EltNum = 0; EltNum < SourceLen; ++EltNum) { APSInt Elt = Source.getVectorElt(EltNum).getInt(); - ResultElements.push_back( - APValue(APSInt(APInt(Info.C

[clang] [clang] constexpr built-in elementwise bitreverse function. (PR #118177)

2024-12-02 Thread Simon Pilgrim via cfe-commits
@@ -11322,9 +11323,19 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) { for (unsigned EltNum = 0; EltNum < SourceLen; ++EltNum) { APSInt Elt = Source.getVectorElt(EltNum).getInt(); - ResultElements.push_back( - APValue(APSInt(APInt(Info.C

[clang] [clang][x86] Add initial constexpr support for VPOPCNTDQ intrinsics (PR #118017)

2024-11-28 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon closed https://github.com/llvm/llvm-project/pull/118017 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][x86] Add initial constexpr support for VPOPCNTDQ intrinsics (PR #118017)

2024-11-28 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon created https://github.com/llvm/llvm-project/pull/118017 Still working on how to make __builtin_ia32_select* intrinsic wrappers constexpr >From 8bb296647847b4d12ae524874ab137ad10421fff Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 28 Nov 2024 15:53:03 +

[clang] [X86] Consistently use __inline__ keyword in intrin.h (PR #117856)

2024-11-27 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon closed https://github.com/llvm/llvm-project/pull/117856 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86] Consistently use __inline__ keyword in intrin.h (PR #117856)

2024-11-27 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM - cheers https://github.com/llvm/llvm-project/pull/117856 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in elementwise popcount function. (PR #117473)

2024-11-25 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon commented: Update LanguageExtensions.rst to mention __builtin_elementwise_popcount is constexpr compatible https://github.com/llvm/llvm-project/pull/117473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [clang] constexpr built-in elementwise popcount function. (PR #117473)

2024-11-24 Thread Simon Pilgrim via cfe-commits
@@ -797,3 +797,8 @@ static_assert(__builtin_reduce_xor((vector4int){(int)0x, (int)0x static_assert(__builtin_reduce_xor((vector4long){(long long)0xL, (long long)0xL, (long long)0xL, (long long)0xL}

[clang] [clang] constexpr built-in elementwise popcount function. (PR #117473)

2024-11-24 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon edited https://github.com/llvm/llvm-project/pull/117473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in elementwise popcount function. (PR #117473)

2024-11-24 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon commented: `__builtin_elementwise_popcount` can be used with a scalar value - please test that as well https://github.com/llvm/llvm-project/pull/117473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang] [llvm] Adjust MSVC disabled optimization pragmas to be _MSC_VER only (PR #116704)

2024-11-21 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon closed https://github.com/llvm/llvm-project/pull/116704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Adjust MSVC disabled optimization pragmas to be _MSC_VER only (PR #116704)

2024-11-21 Thread Simon Pilgrim via cfe-commits
@@ -1616,7 +1616,7 @@ bool Interpret(InterpState &S, APValue &Result) { } } // https://github.com/llvm/llvm-project/issues/102513 -#if defined(_WIN32) && !defined(__clang__) && !defined(NDEBUG) +#if defined(_MSC_VER) && !defined(__clang__) && !defined(NDEBUG) #pragma optimiz

[clang] [llvm] Adjust MSVC disabled optimization pragmas to be _MSC_VER only (PR #116704)

2024-11-21 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon updated https://github.com/llvm/llvm-project/pull/116704 >From 5eed16e1a10b3d078252791c6eb95c9c74585acf Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 18 Nov 2024 22:30:53 + Subject: [PATCH] Adjust MSVC disabled optimization pragmas to be _MSC_VER only A

[clang] [clang] constexpr built-in reduce `or` and `xor` function. (PR #116976)

2024-11-21 Thread Simon Pilgrim via cfe-commits
@@ -732,6 +732,10 @@ at the end to the next power of 2. These reductions support both fixed-sized and scalable vector types. +The reduction intrinsics, including ``__builtin_reduce_add``, RKSimon wrote: "integer reduction intrinsics"? https://github.com/llv

[clang] [clang] constexpr built-in reduce `or` and `xor` function. (PR #116976)

2024-11-20 Thread Simon Pilgrim via cfe-commits
RKSimon wrote: Please can you update the LanguageExtensions doc to mention that these are now constexpr https://github.com/llvm/llvm-project/blob/934140a3353f6d480a01a1f68d42899c926ee056/clang/docs/LanguageExtensions.rst?plain=1#L723-L765 https://github.com/llvm/llvm-project/pull/116976 __

[clang] [clang] constexpr built-in reduce and function. (PR #116822)

2024-11-19 Thread Simon Pilgrim via cfe-commits
@@ -765,3 +765,11 @@ constexpr long long reduceMulLong2 = __builtin_reduce_mul((vector4long){(1LL << // expected-note@-1 {{outside the range of representable values of type 'long long'}} static_assert(__builtin_reduce_mul((vector4uint){~0U, 1, 1, 2}) == ~0U - 1); static_asser

[clang] [llvm] Adjust MSVC disabled optimization pragmas to be _MSC_VER only (PR #116704)

2024-11-18 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon created https://github.com/llvm/llvm-project/pull/116704 Alter the #ifdef values from #110986 and #115292 to use _MSC_VER instead of _WIN32 to stop the pragmas being used on gcc/mingw builds Noticed by @mstorsjo >From e247c69d20cb4b2cb8b52ebb89bc2002c708f54d Mon Sep

[clang] [clang] constexpr built-in reduce mul function. (PR #116626)

2024-11-18 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM - cheers https://github.com/llvm/llvm-project/pull/116626 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] constexpr built-in reduce add function. (PR #116243)

2024-11-18 Thread Simon Pilgrim via cfe-commits
RKSimon wrote: Thanks @c8ef - are you OK to add the remaining integer reduction cases next? Also, please can you also update the LanguageExtensions docs page to mention that they are constexpr legal? https://github.com/llvm/llvm-project/pull/116243 _

[clang] [clang] constexpr built-in reduce add function. (PR #116243)

2024-11-15 Thread Simon Pilgrim via cfe-commits
@@ -723,3 +723,9 @@ not within the bounds of the input vectors; index of -1 found at position 0 is n permitted in a constexpr context}} vector4charConst1, vector4charConst2, -1, -1, -1, -1); + +static_assert(__builtin_reduce_add((vector4char){}) == 0);

[clang] [clang] constexpr built-in reduce add function. (PR #116243)

2024-11-15 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon commented: This seems reasonable to me - I'd recommend you take a look at the min/max reductions to see if signed/unsigned can be correctly handled with this approach. https://github.com/llvm/llvm-project/pull/116243 ___ cf

[clang] [clang] constexpr built-in reduce add function. (PR #116243)

2024-11-15 Thread Simon Pilgrim via cfe-commits
@@ -13528,6 +13528,20 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, return Success(DidOverflow, E); } + case Builtin::BI__builtin_reduce_add: { +APValue Source; +if (!EvaluateAsRValue(Info, E->getArg(0), Source)) + return false; + +

[clang] [clang] constexpr built-in reduce add function. (PR #116243)

2024-11-15 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon edited https://github.com/llvm/llvm-project/pull/116243 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][docs] Revise documentation for `__builtin_reduce_(max|min)`. (PR #114637)

2024-11-13 Thread Simon Pilgrim via cfe-commits
RKSimon wrote: @c8ef why did you close this? https://github.com/llvm/llvm-project/pull/114637 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][docs] Revise documentation for `__builtin_reduce_(max|min)`. (PR #114637)

2024-11-13 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/114637 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][docs] Revise documentation for `__builtin_reduce_(max|min)`. (PR #114637)

2024-11-13 Thread Simon Pilgrim via cfe-commits
@@ -745,12 +745,10 @@ Let ``VT`` be a vector type and ``ET`` the element type of ``VT``. === == == Name

[clang] c955228 - [clang][x86] Add constexpr support for MMX _mm_set*_pi* intrinsics

2024-11-08 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-11-08T15:30:02Z New Revision: c9552283c0bf277eba490cde9fd913510f4111c0 URL: https://github.com/llvm/llvm-project/commit/c9552283c0bf277eba490cde9fd913510f4111c0 DIFF: https://github.com/llvm/llvm-project/commit/c9552283c0bf277eba490cde9fd913510f4111c0.diff LOG:

[clang] 2407ff4 - [clang][x86] Add constexpr support for _mm_movpi64_epi64

2024-11-08 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-11-08T15:30:02Z New Revision: 2407ff4645e9124507a4b5d910603ff7fc9e5734 URL: https://github.com/llvm/llvm-project/commit/2407ff4645e9124507a4b5d910603ff7fc9e5734 DIFF: https://github.com/llvm/llvm-project/commit/2407ff4645e9124507a4b5d910603ff7fc9e5734.diff LOG:

[clang] 0f04043 - [clang][x86] Update MMX intrinsic tests for both C/C++

2024-11-08 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-11-08T14:38:34Z New Revision: 0f040433d325aa68ec6840aa179f3f314c26153a URL: https://github.com/llvm/llvm-project/commit/0f040433d325aa68ec6840aa179f3f314c26153a DIFF: https://github.com/llvm/llvm-project/commit/0f040433d325aa68ec6840aa179f3f314c26153a.diff LOG:

[clang] 53e6f62 - [clang][x86] _mm_movpi64_epi64 - convert to shufflevector pattern instead of bitcasting to i64

2024-11-08 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-11-08T14:38:33Z New Revision: 53e6f627d7e81633b2e159675884bfcce11bdc00 URL: https://github.com/llvm/llvm-project/commit/53e6f627d7e81633b2e159675884bfcce11bdc00 DIFF: https://github.com/llvm/llvm-project/commit/53e6f627d7e81633b2e159675884bfcce11bdc00.diff LOG:

[clang] [llvm] [X86] LowerBITREVERSE - use AND+CMPEQ+MOVMSK trick to lower scalar types (PR #92236)

2024-11-08 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon updated https://github.com/llvm/llvm-project/pull/92236 >From 37fcf8300243fa6236e119743fd6d7067ac515ca Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 7 Nov 2024 17:25:49 + Subject: [PATCH 1/2] [clang][x86] _mm_movpi64_epi64 - convert to shufflevector pat

[clang] [llvm] [X86] LowerBITREVERSE - use AND+CMPEQ+MOVMSK trick to lower scalar types (PR #92236)

2024-11-08 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon updated https://github.com/llvm/llvm-project/pull/92236 >From 37fcf8300243fa6236e119743fd6d7067ac515ca Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 7 Nov 2024 17:25:49 + Subject: [PATCH 1/2] [clang][x86] _mm_movpi64_epi64 - convert to shufflevector pat

[clang] 03baa0a - [clang][x86] Add constexpr support for _mm256_set_pd/_mm256_set_ps/_mm256_set1_pd/_mm256_set1_ps/_mm256_setr_pd/_mm256_setr_ps

2024-11-07 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-11-07T16:00:00Z New Revision: 03baa0ad6140789fc2851f655a4b88c938ec5e14 URL: https://github.com/llvm/llvm-project/commit/03baa0ad6140789fc2851f655a4b88c938ec5e14 DIFF: https://github.com/llvm/llvm-project/commit/03baa0ad6140789fc2851f655a4b88c938ec5e14.diff LOG:

[clang] 39e6dc0 - [clang][x86] avx-builtins.c - reorder tests to keep alpha sorting order. NFC.

2024-11-07 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-11-07T16:00:00Z New Revision: 39e6dc09d2fe824647bc168fbe96f1fc57cb0998 URL: https://github.com/llvm/llvm-project/commit/39e6dc09d2fe824647bc168fbe96f1fc57cb0998 DIFF: https://github.com/llvm/llvm-project/commit/39e6dc09d2fe824647bc168fbe96f1fc57cb0998.diff LOG:

[clang] 712c90e - [clang][x86] Add constexpr support for _mm_cvtsi64_sd

2024-11-06 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-11-06T18:35:03Z New Revision: 712c90e479f975f2e0c5ed4554dbf2f3a7a6d9d6 URL: https://github.com/llvm/llvm-project/commit/712c90e479f975f2e0c5ed4554dbf2f3a7a6d9d6 DIFF: https://github.com/llvm/llvm-project/commit/712c90e479f975f2e0c5ed4554dbf2f3a7a6d9d6.diff LOG:

[clang] 3aa2f63 - [clang][x86] Add constexpr support for _mm_castps_pd/_mm_castps_si128/_mm_castsi128_pd/_mm_castsi128_ps intrinsics

2024-11-06 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-11-06T16:17:29Z New Revision: 3aa2f63822c0d829c875aa41ca2fd0103939dfaf URL: https://github.com/llvm/llvm-project/commit/3aa2f63822c0d829c875aa41ca2fd0103939dfaf DIFF: https://github.com/llvm/llvm-project/commit/3aa2f63822c0d829c875aa41ca2fd0103939dfaf.diff LOG:

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

2024-11-06 Thread Simon Pilgrim via cfe-commits
@@ -31,10 +31,13 @@ // All MMX instructions will be generated via builtins. Any MMX vector // types (<1 x i64>, <2 x i32>, etc.) that aren't used by these builtins will be // expanded by the back-end. +// // FIXME: _mm_prefetch must be a built-in because it takes a compile-ti

[clang] 7585e2f - [clang][x86] Add constexpr support for _mm_movepi64_pi64 and _mm_move_epi64

2024-11-06 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-11-06T15:19:00Z New Revision: 7585e2fd3caee30d5332c93995b7a6f51ab06660 URL: https://github.com/llvm/llvm-project/commit/7585e2fd3caee30d5332c93995b7a6f51ab06660 DIFF: https://github.com/llvm/llvm-project/commit/7585e2fd3caee30d5332c93995b7a6f51ab06660.diff LOG:

[clang] f61a8bc - [clang][x86] Prevent signed/unsigned comparison warnings on constexpr m128i/m256i/m512i match helpers.

2024-11-06 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-11-06T15:19:00Z New Revision: f61a8bc305d60f1ab04225e2b210d8b3d9c97eb8 URL: https://github.com/llvm/llvm-project/commit/f61a8bc305d60f1ab04225e2b210d8b3d9c97eb8 DIFF: https://github.com/llvm/llvm-project/commit/f61a8bc305d60f1ab04225e2b210d8b3d9c97eb8.diff LOG:

[clang] [clang][docs] Revise documentation for `__builtin_reduce_(max|min)`. (PR #114637)

2024-11-03 Thread Simon Pilgrim via cfe-commits
@@ -745,12 +745,8 @@ Let ``VT`` be a vector type and ``ET`` the element type of ``VT``. === == == NameO

[clang] fcaa8c6 - Fix MSVC "signed/unsigned mismatch" warning. NFC.

2024-10-31 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-10-31T11:50:19Z New Revision: fcaa8c6e2240a950d3d86fb723d9b0a363b7346a URL: https://github.com/llvm/llvm-project/commit/fcaa8c6e2240a950d3d86fb723d9b0a363b7346a DIFF: https://github.com/llvm/llvm-project/commit/fcaa8c6e2240a950d3d86fb723d9b0a363b7346a.diff LOG:

[clang] [clang] Add sincos builtin using `llvm.sincos` intrinsic (PR #114086)

2024-10-30 Thread Simon Pilgrim via cfe-commits
RKSimon wrote: CC @rohitaggarwal007 who added sincos vectorisation for amdlibm recently - hopefully we can get ensure amdlibm uses the new builtin + intrinsic safely https://github.com/llvm/llvm-project/pull/114086 ___ cfe-commits mailing list cfe-com

[clang] [Clang] Start moving X86Builtins.def to X86Builtins.td (PR #106005)

2024-10-30 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. https://github.com/llvm/llvm-project/pull/106005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] e281d96 - [clang][x86] Add constexpr support for _mm_add_epi32/64 and _mm_sub_epi32/64

2024-10-29 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-10-29T14:34:19Z New Revision: e281d96a81bca896692da4a07ca1423ee6dc1f53 URL: https://github.com/llvm/llvm-project/commit/e281d96a81bca896692da4a07ca1423ee6dc1f53 DIFF: https://github.com/llvm/llvm-project/commit/e281d96a81bca896692da4a07ca1423ee6dc1f53.diff LOG:

[clang] bf6c483 - [clang][x86] Add constexpr support for SSE2 _mm_set*_epi* intrinsics

2024-10-29 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-10-29T15:39:15Z New Revision: bf6c483e4714841b1511ea3666f05a468bd988fe URL: https://github.com/llvm/llvm-project/commit/bf6c483e4714841b1511ea3666f05a468bd988fe DIFF: https://github.com/llvm/llvm-project/commit/bf6c483e4714841b1511ea3666f05a468bd988fe.diff LOG:

[clang] f257e9b - [clang][x86] Update AVX/AVX512 setzero constexpr tests to use the TEST_CONSTEXPR macro

2024-10-29 Thread Simon Pilgrim via cfe-commits
Author: Simon Pilgrim Date: 2024-10-29T14:34:19Z New Revision: f257e9bdbbb790e4fe0a5e2538c92d7edd85a2e5 URL: https://github.com/llvm/llvm-project/commit/f257e9bdbbb790e4fe0a5e2538c92d7edd85a2e5 DIFF: https://github.com/llvm/llvm-project/commit/f257e9bdbbb790e4fe0a5e2538c92d7edd85a2e5.diff LOG:

[clang] [Clang] Start moving X86Builtins.def to X86Builtins.td (PR #106005)

2024-10-29 Thread Simon Pilgrim via cfe-commits
RKSimon wrote: No objections to this patch, I do want to see other targets moved over as well though, instead of x86 ending up being treated as a special/weird case. I am preparing to convert a lot of x86 builtins to be constexpr (#30794) - but as long as this PR won't interfere I see no big r

[clang] [X86][RFC] Refactor the SSE intrinsics constexpr tests to simplify future expansion (PR #112578)

2024-10-29 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon closed https://github.com/llvm/llvm-project/pull/112578 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86][RFC] Refactor the SSE intrinsics constexpr tests to simplify future expansion (PR #112578)

2024-10-28 Thread Simon Pilgrim via cfe-commits
RKSimon wrote: I've added builtin_test_helpers.h header to share the comparison code - if there's no objections I'll push this tomorrow. https://github.com/llvm/llvm-project/pull/112578 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [X86][RFC] Refactor the SSE intrinsics constexpr tests to simplify future expansion (PR #112578)

2024-10-28 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon updated https://github.com/llvm/llvm-project/pull/112578 >From 38bd7c77c29457f7f20ccf7e6ee8c895707ab07c Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Wed, 16 Oct 2024 17:31:31 +0100 Subject: [PATCH 1/2] [X86][RFC] Refactor the SSE intrinsics constexpr tests to s

[clang] [X86] Don't allow '+f' as an inline asm constraint. (PR #113871)

2024-10-28 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. https://github.com/llvm/llvm-project/pull/113871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Remove optimization flags from clang codegen tests (PR #113714)

2024-10-28 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon edited https://github.com/llvm/llvm-project/pull/113714 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Remove optimization flags from clang codegen tests (PR #113714)

2024-10-28 Thread Simon Pilgrim via cfe-commits
@@ -1,7 +1,7 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 // REQUIRES: x86-registered-target -// RUN: %clang_cc1 -ffreestanding %s -O3 -triple=x86_64-apple-darwin -target-feature +avx -emit-llvm -o - | FileCheck %s --ch

  1   2   3   4   5   6   7   8   9   10   >