[llvm-branch-commits] [llvm] [LV] Bundle sub reductions into VPExpressionRecipe (PR #147255)

2025-07-07 Thread David Sherwood via llvm-branch-commits
@@ -1401,8 +1401,8 @@ static void analyzeCostOfVecReduction(const IntrinsicInst &II, TTI::CastContextHint::None, CostKind, RedOp); CostBeforeReduction = ExtCost * 2 + MulCost + Ext2Cost; -CostAfterReduction = -TTI.getMulAccReductio

[llvm-branch-commits] [llvm] [LV] Bundle sub reductions into VPExpressionRecipe (PR #147255)

2025-07-07 Thread David Sherwood via llvm-branch-commits
@@ -2757,6 +2757,12 @@ class VPExpressionRecipe : public VPSingleDefRecipe { /// vector operands, performing a reduction.add on the result, and adding /// the scalar result to a chain. MulAccReduction, +/// Represent an inloop multiply-accumulate reduction, mult

[llvm-branch-commits] [llvm] [LV] Bundle sub reductions into VPExpressionRecipe (PR #147255)

2025-07-07 Thread David Sherwood via llvm-branch-commits
@@ -5538,7 +5538,7 @@ LoopVectorizationCostModel::getReductionPatternCost(Instruction *I, TTI::CastContextHint::None, CostKind, RedOp); InstructionCost RedCost = TTI.getMulAccReductionCost( -IsUnsigned, RdxDesc.getRecurrenceType(), Ext

[llvm-branch-commits] [llvm] [LV] Bundle sub reductions into VPExpressionRecipe (PR #147255)

2025-07-07 Thread David Sherwood via llvm-branch-commits
@@ -3116,7 +3116,10 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase { InstructionCost getMulAccReductionCost(bool IsUnsigned, Type *ResTy, VectorType *Ty, + bool Negated, TTI::TargetCostKind CostKind) co

[llvm-branch-commits] [llvm] [LV] Bundle sub reductions into VPExpressionRecipe (PR #147255)

2025-07-07 Thread David Sherwood via llvm-branch-commits
@@ -2725,6 +2729,31 @@ void VPExpressionRecipe::print(raw_ostream &O, const Twine &Indent, O << ")"; break; } + case ExpressionTypes::ExtNegatedMulAccReduction: { david-arm wrote: Is there a way to commonise this with the ExtMulAccReduction case if

[llvm-branch-commits] [llvm] [LV] Bundle sub reductions into VPExpressionRecipe (PR #147255)

2025-07-07 Thread David Sherwood via llvm-branch-commits
@@ -1645,8 +1645,10 @@ class TargetTransformInfo { /// extensions. This is the cost of as: /// ResTy vecreduce.add(mul (A, B)). /// ResTy vecreduce.add(mul(ext(Ty A), ext(Ty B)). + /// The multiply can optionally be negated, which signifies that it is a sub + /// reduct

[llvm-branch-commits] [llvm] [LoopVectorizer] Bundle partial reductions inside VPMulAccumulateReductionRecipe (PR #136173)

2025-04-29 Thread David Sherwood via llvm-branch-commits
david-arm wrote: Ah perhaps this is my mistake. You did say it depends upon https://github.com/llvm/llvm-project/pull/113903. :) https://github.com/llvm/llvm-project/pull/136173 ___ llvm-branch-commits mailing list l

[llvm-branch-commits] [llvm] [LoopVectorizer] Bundle partial reductions inside VPMulAccumulateReductionRecipe (PR #136173)

2025-04-29 Thread David Sherwood via llvm-branch-commits
david-arm wrote: I tried downloading this patch and applying to the HEAD of LLVM and `patch` said this diff had already been applied. Does the PR need rebasing? https://github.com/llvm/llvm-project/pull/136173 ___ ll

[llvm-branch-commits] [llvm] [LV] Reduce register usage for scaled reductions (PR #133090)

2025-04-10 Thread David Sherwood via llvm-branch-commits
@@ -5039,10 +5039,25 @@ calculateRegisterUsage(VPlan &Plan, ArrayRef VFs, // even in the scalar case. RegUsage[ClassID] += 1; } else { +// The output from scaled phis and scaled reductions actually have +// fewer lanes

[llvm-branch-commits] [llvm] [LV] Reduce register usage for scaled reductions (PR #133090)

2025-04-10 Thread David Sherwood via llvm-branch-commits
@@ -45,9 +45,9 @@ define void @load_and_compare_only_used_by_assume(ptr %a, ptr noalias %b) { ; CHECK-LABEL: LV: Checking a loop in 'load_and_compare_only_used_by_assume' ; CHECK: LV(REG): VF = vscale x 4 ; CHECK-NEXT: LV(REG): Found max usage: 2 item -; CHECK-NEXT: LV(REG): R

[llvm-branch-commits] [llvm] [LV] Reduce register usage for scaled reductions (PR #133090)

2025-04-10 Thread David Sherwood via llvm-branch-commits
@@ -46,6 +46,11 @@ define i1 @select_exit_cond(ptr %start, ptr %end, i64 %N) { ; CHECK-NEXT:[[STEP_ADD_5:%.*]] = add <2 x i64> [[STEP_ADD_4]], splat (i64 2) ; CHECK-NEXT:[[STEP_ADD_6:%.*]] = add <2 x i64> [[STEP_ADD_5]], splat (i64 2) ; CHECK-NEXT:[[STEP_ADD_7:%.*

[llvm-branch-commits] [llvm] [LV] Reduce register usage for scaled reductions (PR #133090)

2025-04-10 Thread David Sherwood via llvm-branch-commits
@@ -2,6 +2,7 @@ ; RUN: opt -passes=loop-vectorize -enable-epilogue-vectorization=false -mattr=+neon,+dotprod -force-vector-interleave=1 -S < %s | FileCheck %s --check-prefixes=CHECK-INTERLEAVE1 ; RUN: opt -passes=loop-vectorize -enable-epilogue-vectorization=false -mattr=+neo

[llvm-branch-commits] [llvm] [LV] Reduce register usage for scaled reductions (PR #133090)

2025-04-07 Thread David Sherwood via llvm-branch-commits
@@ -2033,6 +2033,8 @@ class VPReductionPHIRecipe : public VPHeaderPHIRecipe, /// Generate the phi/select nodes. void execute(VPTransformState &State) override; + unsigned getVFScaleFactor() const { return VFScaleFactor; } david-arm wrote: Perhaps good to

[llvm-branch-commits] [llvm] release/20.x: [LoopVectorize] Fix cost model assert when vectorising calls (#125716) (PR #126209)

2025-02-07 Thread David Sherwood via llvm-branch-commits
david-arm wrote: Also needs a build error fix - 3872e55758a5de035c032a975f244302c3ddacc3. Not sure the best way to do this - should I backport two commits or create a new PR with a joint patch? https://github.com/llvm/llvm-project/pull/126209 ___ llv

[llvm-branch-commits] [llvm] release/19.x: [MachineLICM] Don't allow hoisting invariant loads across mem barrier. (#116987) (PR #117154)

2024-11-25 Thread David Sherwood via llvm-branch-commits
david-arm wrote: > @david-arm Should this be merged? Hi yes I think it should be merged. It's a fairly serious bug fix. https://github.com/llvm/llvm-project/pull/117154 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://li

[llvm-branch-commits] [llvm] PR for llvm/llvm-project#80140 (PR #80141)

2024-01-31 Thread David Sherwood via llvm-branch-commits
https://github.com/david-arm approved this pull request. LGTM. This is a critical fix for SME to ensure correct behaviour and prevent stack corruption. https://github.com/llvm/llvm-project/pull/80141 ___ llvm-branch-commits mailing list llvm-branch-co

[llvm-branch-commits] [clang] PR for llvm/llvm-project#79564 (PR #79566)

2024-01-26 Thread David Sherwood via llvm-branch-commits
https://github.com/david-arm approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/79566 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] 6584a9a - [release][docs] Update contributions to LLVM 12 for scalable vectors.

2021-02-18 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2021-02-18T09:07:28Z New Revision: 6584a9a4c55e10c055f9f450798b826a9624d82f URL: https://github.com/llvm/llvm-project/commit/6584a9a4c55e10c055f9f450798b826a9624d82f DIFF: https://github.com/llvm/llvm-project/commit/6584a9a4c55e10c055f9f450798b826a9624d82f.diff LOG

[llvm-branch-commits] [llvm] 83e7a96 - Fix build failure caused by 2e080eb00ad76654313e0e119bb7fa0ffe2f9866

2021-01-22 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2021-01-22T09:56:53Z New Revision: 83e7a96c06835eb37416ffdc463edc7ddd18656c URL: https://github.com/llvm/llvm-project/commit/83e7a96c06835eb37416ffdc463edc7ddd18656c DIFF: https://github.com/llvm/llvm-project/commit/83e7a96c06835eb37416ffdc463edc7ddd18656c.diff LOG

[llvm-branch-commits] [llvm] 2e080eb - [SVE] Add support for scalable vectorization of loops with selects and cmps

2021-01-22 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2021-01-22T09:48:13Z New Revision: 2e080eb00ad76654313e0e119bb7fa0ffe2f9866 URL: https://github.com/llvm/llvm-project/commit/2e080eb00ad76654313e0e119bb7fa0ffe2f9866 DIFF: https://github.com/llvm/llvm-project/commit/2e080eb00ad76654313e0e119bb7fa0ffe2f9866.diff LOG

[llvm-branch-commits] [llvm] 255a507 - [NFC][InstructionCost] Use InstructionCost in lib/Transforms/IPO/IROutliner.cpp

2021-01-20 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2021-01-20T08:33:59Z New Revision: 255a507716bca63a375f3b8a379ccbbc58cb40da URL: https://github.com/llvm/llvm-project/commit/255a507716bca63a375f3b8a379ccbbc58cb40da DIFF: https://github.com/llvm/llvm-project/commit/255a507716bca63a375f3b8a379ccbbc58cb40da.diff LOG

[llvm-branch-commits] [llvm] c3ce262 - [NFC] Make remaining cost functions in LoopVectorize.cpp use InstructionCost

2021-01-19 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2021-01-19T09:08:40Z New Revision: c3ce2627949eee3b5d3012db78f670919a49b35d URL: https://github.com/llvm/llvm-project/commit/c3ce2627949eee3b5d3012db78f670919a49b35d DIFF: https://github.com/llvm/llvm-project/commit/c3ce2627949eee3b5d3012db78f670919a49b35d.diff LOG

[llvm-branch-commits] [llvm] 4cd4853 - [NFC][InstructionCost] Use InstructionCost in Transforms/Scalar/RewriteStatepointsForGC.cpp

2021-01-13 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2021-01-13T09:42:58Z New Revision: 4cd48535eca06245c89a9158844bb177c6f8eb63 URL: https://github.com/llvm/llvm-project/commit/4cd48535eca06245c89a9158844bb177c6f8eb63 DIFF: https://github.com/llvm/llvm-project/commit/4cd48535eca06245c89a9158844bb177c6f8eb63.diff LOG

[llvm-branch-commits] [llvm] 40abeb1 - [NFC][InstructionCost] Change LoopVectorizationCostModel::getInstructionCost to return InstructionCost

2021-01-11 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2021-01-11T09:22:37Z New Revision: 40abeb11f4584e8a07163d6c7e24011ac45f104c URL: https://github.com/llvm/llvm-project/commit/40abeb11f4584e8a07163d6c7e24011ac45f104c DIFF: https://github.com/llvm/llvm-project/commit/40abeb11f4584e8a07163d6c7e24011ac45f104c.diff LOG

[llvm-branch-commits] [llvm] b7ccaca - [NFC] Remove min/max functions from InstructionCost

2021-01-11 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2021-01-11T09:00:12Z New Revision: b7ccaca53700fce21b0e8e5d7bd2a956bd391fee URL: https://github.com/llvm/llvm-project/commit/b7ccaca53700fce21b0e8e5d7bd2a956bd391fee DIFF: https://github.com/llvm/llvm-project/commit/b7ccaca53700fce21b0e8e5d7bd2a956bd391fee.diff LOG

[llvm-branch-commits] [clang] 38d18d9 - [SVE] Add support to vectorize_width loop pragma for scalable vectors

2021-01-08 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2021-01-08T11:37:27Z New Revision: 38d18d93534d290d045bbbfa86337e70f1139dc2 URL: https://github.com/llvm/llvm-project/commit/38d18d93534d290d045bbbfa86337e70f1139dc2 DIFF: https://github.com/llvm/llvm-project/commit/38d18d93534d290d045bbbfa86337e70f1139dc2.diff LOG

[llvm-branch-commits] [llvm] d1bf26f - [AArch64][SVE] Add lowering for llvm abs intrinsic

2021-01-08 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2021-01-08T08:55:25Z New Revision: d1bf26fd943e39a4e3bb55bdaeec5559e74dee99 URL: https://github.com/llvm/llvm-project/commit/d1bf26fd943e39a4e3bb55bdaeec5559e74dee99 DIFF: https://github.com/llvm/llvm-project/commit/d1bf26fd943e39a4e3bb55bdaeec5559e74dee99.diff LOG

[llvm-branch-commits] [llvm] a650920 - [SVE] Fix inline assembly parsing crash

2021-01-04 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2021-01-04T09:11:05Z New Revision: a65092040ad4fefcdad18382781090839cad3b67 URL: https://github.com/llvm/llvm-project/commit/a65092040ad4fefcdad18382781090839cad3b67 DIFF: https://github.com/llvm/llvm-project/commit/a65092040ad4fefcdad18382781090839cad3b67.diff LOG

[llvm-branch-commits] [llvm] 3bf7d47 - [NFC][InstructionCost] Remove isValid() asserts in SLPVectorizer.cpp

2020-12-21 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2020-12-21T09:12:28Z New Revision: 3bf7d47a977d463940f558259d24d43d76d50e6f URL: https://github.com/llvm/llvm-project/commit/3bf7d47a977d463940f558259d24d43d76d50e6f DIFF: https://github.com/llvm/llvm-project/commit/3bf7d47a977d463940f558259d24d43d76d50e6f.diff LOG

[llvm-branch-commits] [llvm] 616f978 - Fix build issue caused by 9b76160e53f67008ff21095098129a2949595a06

2020-12-11 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2020-12-11T09:43:55Z New Revision: 616f9781af076942c177abcb7041761924757ea6 URL: https://github.com/llvm/llvm-project/commit/616f9781af076942c177abcb7041761924757ea6 DIFF: https://github.com/llvm/llvm-project/commit/616f9781af076942c177abcb7041761924757ea6.diff LOG

[llvm-branch-commits] [llvm] 9b76160 - [Support] Introduce a new InstructionCost class

2020-12-11 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2020-12-11T08:12:54Z New Revision: 9b76160e53f67008ff21095098129a2949595a06 URL: https://github.com/llvm/llvm-project/commit/9b76160e53f67008ff21095098129a2949595a06 DIFF: https://github.com/llvm/llvm-project/commit/9b76160e53f67008ff21095098129a2949595a06.diff LOG

[llvm-branch-commits] [llvm] e22259f - [SVE] Remove duplicate assert in DAGTypeLegalizer::SplitVecOp_EXTRACT_SUBVECTOR

2020-12-08 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2020-12-08T14:41:14Z New Revision: e22259fafe5e2f5e0219366ff92bba15ec70ff56 URL: https://github.com/llvm/llvm-project/commit/e22259fafe5e2f5e0219366ff92bba15ec70ff56 DIFF: https://github.com/llvm/llvm-project/commit/e22259fafe5e2f5e0219366ff92bba15ec70ff56.diff LOG

[llvm-branch-commits] [llvm] 59f17b5 - [SVE] Fix crashes with inline assembly

2020-12-08 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2020-12-08T13:48:43Z New Revision: 59f17b57d9c9abf86d8dcc05c49d3bbd807e29c7 URL: https://github.com/llvm/llvm-project/commit/59f17b57d9c9abf86d8dcc05c49d3bbd807e29c7 DIFF: https://github.com/llvm/llvm-project/commit/59f17b57d9c9abf86d8dcc05c49d3bbd807e29c7.diff LOG

[llvm-branch-commits] [llvm] 71bd59f - [SVE] Add support for scalable vectors with vectorize.scalable.enable loop attribute

2020-12-02 Thread David Sherwood via llvm-branch-commits
Author: David Sherwood Date: 2020-12-02T13:23:43Z New Revision: 71bd59f0cb6db0211418b07127e8b311d944e2c2 URL: https://github.com/llvm/llvm-project/commit/71bd59f0cb6db0211418b07127e8b311d944e2c2 DIFF: https://github.com/llvm/llvm-project/commit/71bd59f0cb6db0211418b07127e8b311d944e2c2.diff LOG