[llvm-branch-commits] [llvm] [LV] Choose best reduction for VPlan (PR #166138)

2025-11-04 Thread Sushant Gokhale via llvm-branch-commits
@@ -0,0 +1,136 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6 +; RUN: opt -S -mcpu=neoverse-v2 -passes=loop-vectorize -mtriple=aarch64 < %s | FileCheck %s +target triple = "aarch64" + +; Check that a partial reduction is rever

[llvm-branch-commits] [llvm] [LV] Choose best reduction for VPlan (PR #166138)

2025-11-04 Thread Sushant Gokhale via llvm-branch-commits
@@ -3773,19 +3775,76 @@ static void tryToCreateAbstractReductionRecipe(VPReductionRecipe *Red, AbstractR = ExtRed; // Cannot create abstract inloop reduction recipes. if (!AbstractR) -return; +return false; AbstractR->insertBefore(*VPBB, IP); Red->repla

[llvm-branch-commits] [llvm] [LV] Choose best reduction for VPlan (PR #166138)

2025-11-04 Thread Sushant Gokhale via llvm-branch-commits
@@ -3773,19 +3775,76 @@ static void tryToCreateAbstractReductionRecipe(VPReductionRecipe *Red, AbstractR = ExtRed; // Cannot create abstract inloop reduction recipes. if (!AbstractR) -return; +return false; AbstractR->insertBefore(*VPBB, IP); Red->repla

[llvm-branch-commits] [llvm] [LV] Choose best reduction for VPlan (PR #166138)

2025-11-04 Thread Sushant Gokhale via llvm-branch-commits
@@ -5679,6 +5679,18 @@ InstructionCost AArch64TTIImpl::getPartialReductionCost( if (CostKind != TTI::TCK_RecipThroughput) return Invalid; + unsigned Ratio = + AccumType->getScalarSizeInBits() / InputTypeA->getScalarSizeInBits(); + + // A ratio of 1 would mean it's

[llvm-branch-commits] [llvm] [LV] Choose best reduction for VPlan (PR #166138)

2025-11-04 Thread Sushant Gokhale via llvm-branch-commits
@@ -3773,19 +3775,76 @@ static void tryToCreateAbstractReductionRecipe(VPReductionRecipe *Red, AbstractR = ExtRed; // Cannot create abstract inloop reduction recipes. if (!AbstractR) -return; +return false; AbstractR->insertBefore(*VPBB, IP); Red->repla

[llvm-branch-commits] [llvm] [DA] Fix Strong SIV test for symbolic coefficients and deltas (#149977) (PR #157738)

2025-09-15 Thread Sushant Gokhale via llvm-branch-commits
@@ -1249,10 +1249,33 @@ bool DependenceInfo::strongSIVtest(const SCEV *Coeff, const SCEV *SrcConst, SE->isKnownNonNegative(Coeff) ? Coeff : SE->getNegativeSCEV(Coeff); const SCEV *Product = SE->getMulExpr(UpperBound, AbsCoeff); if (isKnownPredicate(CmpInst::ICM

[llvm-branch-commits] [llvm] [DA] Fix Strong SIV test for symbolic coefficients and deltas (#149977) (PR #157738)

2025-09-15 Thread Sushant Gokhale via llvm-branch-commits
@@ -1249,10 +1249,33 @@ bool DependenceInfo::strongSIVtest(const SCEV *Coeff, const SCEV *SrcConst, SE->isKnownNonNegative(Coeff) ? Coeff : SE->getNegativeSCEV(Coeff); const SCEV *Product = SE->getMulExpr(UpperBound, AbsCoeff); if (isKnownPredicate(CmpInst::ICM

[llvm-branch-commits] [llvm] [DA] Fix Strong SIV test for symbolic coefficients and deltas (#149977) (PR #157738)

2025-09-15 Thread Sushant Gokhale via llvm-branch-commits
@@ -1293,9 +1316,40 @@ bool DependenceInfo::strongSIVtest(const SCEV *Coeff, const SCEV *SrcConst, Result.DV[Level].Distance = Delta; // since X/1 == X NewConstraint.setDistance(Delta, CurLoop); } else { - Result.Consistent = false; - NewConstraint.se

[llvm-branch-commits] [llvm] [PHIElimination] Reuse existing COPY in predecessor basic block (Take Two) (PR #146806)

2025-07-03 Thread Sushant Gokhale via llvm-branch-commits
sushgokh wrote: > @mikaelholmen @mstorsjo @macurtis-amd @sjoerdmeijer @sushgokh We've decided > that it's best to revert the original PR (see #146850), sorry for wasting > your time. This PR is trying to reintroduce it with fixes to the issues > you've presented. Can I humbly ask you to test t