https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/73158
>From 13a26e8e7440c3b501730b22588af393a3e543cd Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 6 Jul 2023 08:07:45 +0100
Subject: [PATCH 1/4] [VPlan] Implement cloning of VPlans.
This patch implements clonin
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/73158
>From 13a26e8e7440c3b501730b22588af393a3e543cd Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 6 Jul 2023 08:07:45 +0100
Subject: [PATCH 1/5] [VPlan] Implement cloning of VPlans.
This patch implements clonin
https://github.com/fhahn closed https://github.com/llvm/llvm-project/pull/73158
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/76090
>From 7c31c8bc2acf60bd50cb6d63944ee8d4946b9638 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 4 May 2023 21:33:24 +0100
Subject: [PATCH 1/3] [VPlan] Replace VPRecieOrVPValue with VP2VP recipe
simplification
fhahn wrote:
@Enna1 thanks, should be fixed by 1b37e8087e1e1ecf5aadd8da536ee17dc21832e2. Bot
should be back to green
https://github.com/llvm/llvm-project/pull/73158
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/76090
>From 7c31c8bc2acf60bd50cb6d63944ee8d4946b9638 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 4 May 2023 21:33:24 +0100
Subject: [PATCH 1/4] [VPlan] Replace VPRecieOrVPValue with VP2VP recipe
simplification
@@ -8378,9 +8357,8 @@ void VPRecipeBuilder::fixHeaderPhis() {
}
}
-VPRecipeOrVPValueTy VPRecipeBuilder::handleReplication(Instruction *I,
- VFRange &Range,
- VPlan &Pl
@@ -8999,6 +8963,18 @@ void
LoopVectorizationPlanner::adjustRecipesForReductions(
LinkVPBB->insert(FMulRecipe, CurrentLink->getIterator());
VecOp = FMulRecipe;
} else {
+auto *Blend = dyn_cast(CurrentLink);
fhahn wrote:
Done, tha
@@ -806,6 +806,19 @@ static unsigned getOpcodeForRecipe(VPRecipeBase &R) {
/// Try to simplify recipe \p R.
static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
+ // Try to remove redundant blend recipes.
+ if (auto *Blend = dyn_cast(&R)) {
+bool AllEq
@@ -8999,6 +8963,18 @@ void
LoopVectorizationPlanner::adjustRecipesForReductions(
LinkVPBB->insert(FMulRecipe, CurrentLink->getIterator());
VecOp = FMulRecipe;
} else {
+auto *Blend = dyn_cast(CurrentLink);
+if (PhiR->isInLoop() && Blend)
@@ -8999,6 +8963,18 @@ void
LoopVectorizationPlanner::adjustRecipesForReductions(
LinkVPBB->insert(FMulRecipe, CurrentLink->getIterator());
VecOp = FMulRecipe;
} else {
+auto *Blend = dyn_cast(CurrentLink);
+if (PhiR->isInLoop() && Blend)
@@ -116,12 +111,11 @@ class VPRecipeBuilder {
/// Check if an existing VPValue can be used for \p Instr or a recipe can be
/// create for \p I withing the given VF \p Range. If an existing VPValue can
fhahn wrote:
Updated, thanks!
https://github.com/llvm
@@ -88,8 +86,8 @@ class VPRecipeBuilder {
/// or a new VPBlendRecipe otherwise. Currently all such phi nodes are turned
fhahn wrote:
Updated, thanks!
https://github.com/llvm/llvm-project/pull/76090
___
cfe-commits m
@@ -8292,13 +8271,13 @@ VPRecipeOrVPValueTy VPRecipeBuilder::tryToBlend(PHINode
*Phi,
for (unsigned In = 0; In < NumIncoming; In++) {
VPValue *EdgeMask =
createEdgeMask(Phi->getIncomingBlock(In), Phi->getParent(), *Plan);
-assert((EdgeMask || NumIncoming == 1
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/78304
>From 9846f970b6b394ccc3af25b92f238377a8ae7807 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Sun, 14 Jan 2024 18:06:36 +
Subject: [PATCH] [LV] Improve AnyOf reduction codegen.
Update AnyOf reduction code ge
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/76090
>From 7c31c8bc2acf60bd50cb6d63944ee8d4946b9638 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 4 May 2023 21:33:24 +0100
Subject: [PATCH 1/4] [VPlan] Replace VPRecieOrVPValue with VP2VP recipe
simplification
@@ -9027,7 +8994,8 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
// the phi until LoopExitValue. We keep track of the previous item
// (PreviousLink) to tell which of the two operands of a Link will remain
// scalar and which will be reduced. For min
@@ -9058,6 +9026,20 @@ void
LoopVectorizationPlanner::adjustRecipesForReductions(
LinkVPBB->insert(FMulRecipe, CurrentLink->getIterator());
VecOp = FMulRecipe;
} else {
+auto *Blend = dyn_cast(CurrentLink);
+if (PhiR->isInLoop() && Blend)
@@ -827,6 +827,16 @@ static unsigned getOpcodeForRecipe(VPRecipeBase &R) {
/// Try to simplify recipe \p R.
static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
+ // Try to remove redundant blend recipes.
+ if (auto *Blend = dyn_cast(&R)) {
---
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/76090
>From 7c31c8bc2acf60bd50cb6d63944ee8d4946b9638 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 4 May 2023 21:33:24 +0100
Subject: [PATCH 1/5] [VPlan] Replace VPRecieOrVPValue with VP2VP recipe
simplification
https://github.com/fhahn closed https://github.com/llvm/llvm-project/pull/76090
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/78304
>From 9846f970b6b394ccc3af25b92f238377a8ae7807 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Sun, 14 Jan 2024 18:06:36 +
Subject: [PATCH] [LV] Improve AnyOf reduction codegen.
Update AnyOf reduction code ge
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/78304
>From 9846f970b6b394ccc3af25b92f238377a8ae7807 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Sun, 14 Jan 2024 18:06:36 +
Subject: [PATCH 1/2] [LV] Improve AnyOf reduction codegen.
Update AnyOf reduction cod
fhahn wrote:
Thanks for confirming!
https://github.com/llvm/llvm-project/pull/77695
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/78632
>From a786cdedc2c9a9898cd0b80d84f5b11aace5da1c Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Tue, 28 Nov 2023 15:44:02 +
Subject: [PATCH 1/7] [AArch64] Add custom lowering for load <3 x i8>.
Add custom comb
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/78632
>From a786cdedc2c9a9898cd0b80d84f5b11aace5da1c Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Tue, 28 Nov 2023 15:44:02 +
Subject: [PATCH 1/9] [AArch64] Add custom lowering for load <3 x i8>.
Add custom comb
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/78632
>From a786cdedc2c9a9898cd0b80d84f5b11aace5da1c Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Tue, 28 Nov 2023 15:44:02 +
Subject: [PATCH 01/10] [AArch64] Add custom lowering for load <3 x i8>.
Add custom co
fhahn wrote:
Thanks for taking a look @TNorthover! I tried to address the comments, but with
them addressed it turned out to not really be feasible to go down that path. I
changed the codegen back to use the slightly longer (but using instructions
that are cheaper/less complex usually) below,
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/72647
>From 3dfe86782806f048b130d46afa6293712919f672 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Fri, 14 Apr 2023 14:33:57 +0100
Subject: [PATCH 1/2] [Matrix] Convert column-vector ops feeding dot product to
row-ve
@@ -1391,7 +1394,26 @@ class LowerMatrixIntrinsics {
return TTI.getMemoryOpCost(Instruction::Load, VecTy, Align(1), 0) -
N * TTI.getMemoryOpCost(Instruction::Load, EltTy, Align(1), 0);
};
-auto LHSCost = GetCostForArg(LHS, LShape.NumColumns);
+
--
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/76090
>From 7c31c8bc2acf60bd50cb6d63944ee8d4946b9638 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 4 May 2023 21:33:24 +0100
Subject: [PATCH] [VPlan] Replace VPRecieOrVPValue with VP2VP recipe
simplification.
M
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/76090
>From 7c31c8bc2acf60bd50cb6d63944ee8d4946b9638 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 4 May 2023 21:33:24 +0100
Subject: [PATCH 1/2] [VPlan] Replace VPRecieOrVPValue with VP2VP recipe
simplification
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/76090
>From 7c31c8bc2acf60bd50cb6d63944ee8d4946b9638 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 4 May 2023 21:33:24 +0100
Subject: [PATCH 1/3] [VPlan] Replace VPRecieOrVPValue with VP2VP recipe
simplification
https://github.com/fhahn commented:
Thanks for taking a look, comments should be addressed!
> Wonder if tryTo*()'s should return more specific recipes than VPRecipeBase*,
> as in tryToBlend().
That would probably be good now! Should I adjust the current patch or do as
follow-up?
https://g
https://github.com/fhahn edited https://github.com/llvm/llvm-project/pull/76090
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -9079,6 +9043,9 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
LinkVPBB->insert(FMulRecipe, CurrentLink->getIterator());
VecOp = FMulRecipe;
} else {
+if (PhiR->isInLoop() && isa(CurrentLink))
+ continue;
+
--
@@ -112,7 +112,6 @@ struct VPlanTransforms {
/// Remove redundant EpxandSCEVRecipes in \p Plan's entry block by replacing
/// them with already existing recipes expanding the same SCEV expression.
static void removeRedundantExpandSCEVRecipes(VPlan &Plan);
-
--
@@ -806,6 +806,38 @@ static unsigned getOpcodeForRecipe(VPRecipeBase &R) {
/// Try to simplify recipe \p R.
static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
+ // Try to remove redundant blend recipes.
+ if (auto *Blend = dyn_cast(&R)) {
+if (Blend-
@@ -8292,13 +8271,13 @@ VPRecipeOrVPValueTy VPRecipeBuilder::tryToBlend(PHINode
*Phi,
for (unsigned In = 0; In < NumIncoming; In++) {
VPValue *EdgeMask =
createEdgeMask(Phi->getIncomingBlock(In), Phi->getParent(), *Plan);
-assert((EdgeMask || NumIncoming == 1
@@ -996,8 +1028,8 @@ void VPlanTransforms::optimize(VPlan &Plan,
ScalarEvolution &SE) {
removeRedundantCanonicalIVs(Plan);
removeRedundantInductionCasts(Plan);
- optimizeInductions(Plan, SE);
simplifyRecipes(Plan, SE.getContext());
+ optimizeInductions(Plan, SE);
---
@@ -8966,10 +8930,10 @@ VPlanPtr LoopVectorizationPlanner::buildVPlan(VFRange
&Range) {
}
// Adjust the recipes for reductions. For in-loop reductions the chain of
-// instructions leading from the loop exit instr to the phi need to be
converted
-// to reductions, with one o
@@ -806,6 +806,38 @@ static unsigned getOpcodeForRecipe(VPRecipeBase &R) {
/// Try to simplify recipe \p R.
static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
+ // Try to remove redundant blend recipes.
+ if (auto *Blend = dyn_cast(&R)) {
+if (Blend-
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/77094
>From 46fbecfce6c48795ea85fc9420067479f6d0b17a Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Fri, 5 Jan 2024 11:24:59 +
Subject: [PATCH] [CGP] Avoid replacing a free ext with multiple other exts.
Replacing
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/77094
>From 46fbecfce6c48795ea85fc9420067479f6d0b17a Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Fri, 5 Jan 2024 11:24:59 +
Subject: [PATCH 1/2] [CGP] Avoid replacing a free ext with multiple other
exts.
Repla
https://github.com/fhahn closed https://github.com/llvm/llvm-project/pull/77094
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/77023
>From ddecbda9f079584a55feed322d8d20b766349ab9 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 4 Jan 2024 22:07:31 +
Subject: [PATCH 1/3] [VPlan] Introduce VPSingleDefRecipe.
This patch introduces a new
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/77023
>From ddecbda9f079584a55feed322d8d20b766349ab9 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 4 Jan 2024 22:07:31 +
Subject: [PATCH 1/4] [VPlan] Introduce VPSingleDefRecipe.
This patch introduces a new
@@ -12,6 +12,8 @@
///VPBlockBase, together implementing a Hierarchical CFG;
/// 2. Pure virtual VPRecipeBase serving as the base class for recipes
contained
///within VPBasicBlocks;
+/// 3. Pure virtual VPSingleDefRecipe serving as a base class for recipes that
+///
@@ -819,10 +812,77 @@ class VPRecipeBase : public
ilist_node_with_parent,
}
\
static inline bool classof(const VPRecipeBase *R) {
\
return R->getVPDefID() == VPDefID;
@@ -819,10 +812,77 @@ class VPRecipeBase : public
ilist_node_with_parent,
}
\
static inline bool classof(const VPRecipeBase *R) {
\
return R->getVPDefID() == VPDefID;
@@ -819,10 +812,77 @@ class VPRecipeBase : public
ilist_node_with_parent,
}
\
static inline bool classof(const VPRecipeBase *R) {
\
return R->getVPDefID() == VPDefID;
@@ -912,25 +970,28 @@ class VPRecipeWithIRFlags : public VPRecipeBase {
} else if (auto *Op = dyn_cast(&I)) {
OpType = OperationType::FPMathOp;
FMFs = Op->getFastMathFlags();
+} else {
+ OpType = OperationType::Other;
+ AllFlags = 0;
--
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/77023
>From ddecbda9f079584a55feed322d8d20b766349ab9 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 4 Jan 2024 22:07:31 +
Subject: [PATCH 1/5] [VPlan] Introduce VPSingleDefRecipe.
This patch introduces a new
https://github.com/fhahn closed https://github.com/llvm/llvm-project/pull/77023
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
fhahn wrote:
It looks like this may also break both Blender and Povray. Worked around build
failures in SPEC2017 in llvm-test-suite in
9b14a92d585657b87f2ca2b135ba9044685393be, but the projects will likely need to
be fixed at the source.
https://github.com/llvm/llvm-project/pull/74676
___
@@ -5,6 +5,8 @@
; RUN: %ld64 -lto_library %llvmshlibdir/libLTO.dylib -dylib -arch x86_64
-macos_version_min 10.10.0 -o %t.dylib %t.o -save-temps -undefined
dynamic_lookup -exported_symbol _bar -lSystem -mllvm
-lto-discard-value-names=false
; RUN: llvm-dis %t.dylib.lto.opt.bc
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/73158
>From 13a26e8e7440c3b501730b22588af393a3e543cd Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 6 Jul 2023 08:07:45 +0100
Subject: [PATCH] [VPlan] Implement cloning of VPlans.
This patch implements cloning fo
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/73158
>From 13a26e8e7440c3b501730b22588af393a3e543cd Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 6 Jul 2023 08:07:45 +0100
Subject: [PATCH] [VPlan] Implement cloning of VPlans.
This patch implements cloning fo
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/73158
>From 13a26e8e7440c3b501730b22588af393a3e543cd Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 6 Jul 2023 08:07:45 +0100
Subject: [PATCH 1/2] [VPlan] Implement cloning of VPlans.
This patch implements clonin
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/73158
>From 13a26e8e7440c3b501730b22588af393a3e543cd Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Thu, 6 Jul 2023 08:07:45 +0100
Subject: [PATCH 1/2] [VPlan] Implement cloning of VPlans.
This patch implements clonin
https://github.com/fhahn edited https://github.com/llvm/llvm-project/pull/73158
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -982,6 +994,65 @@ void VPlan::updateDominatorTree(DominatorTree *DT,
BasicBlock *LoopHeaderBB,
assert(DT->verify(DominatorTree::VerificationLevel::Fast));
}
+static void remapVPValues(VPBasicBlock *OldBB, VPBasicBlock *NewBB,
+ DenseMap &Old2NewV
@@ -982,6 +994,65 @@ void VPlan::updateDominatorTree(DominatorTree *DT,
BasicBlock *LoopHeaderBB,
assert(DT->verify(DominatorTree::VerificationLevel::Fast));
}
+static void remapVPValues(VPBasicBlock *OldBB, VPBasicBlock *NewBB,
+ DenseMap &Old2NewV
@@ -1200,6 +1271,59 @@ void VPUser::printOperands(raw_ostream &O, VPSlotTracker
&SlotTracker) const {
}
#endif
+VPBlockBase *VPBlockUtils::cloneCFG(
+VPBlockBase *Entry, DenseMap &Old2New,
+DenseMap &Old2NewVPValues, bool FullRemapping) {
+ ReversePostOrderTraversal>
@@ -1594,6 +1657,13 @@ class VPWidenPHIRecipe : public VPHeaderPHIRecipe {
addOperand(Start);
}
+ VPRecipeBase *clone() override {
+auto *Res = new VPWidenPHIRecipe(cast(getUnderlyingInstr()),
fhahn wrote:
Yep
https://github.com/llvm/llvm-projec
@@ -982,6 +994,65 @@ void VPlan::updateDominatorTree(DominatorTree *DT,
BasicBlock *LoopHeaderBB,
assert(DT->verify(DominatorTree::VerificationLevel::Fast));
}
+static void remapVPValues(VPBasicBlock *OldBB, VPBasicBlock *NewBB,
+ DenseMap &Old2NewV
@@ -615,6 +615,18 @@ void VPBasicBlock::print(raw_ostream &O, const Twine
&Indent,
}
#endif
+VPBlockBase *VPRegionBlock::clone() {
+ DenseMap Old2New;
+ DenseMap Old2NewVPValues;
+ VPBlockBase *NewEntry =
+ VPBlockUtils::cloneCFG(Entry, Old2New, Old2NewVPValues);
+ a
@@ -1200,6 +1271,59 @@ void VPUser::printOperands(raw_ostream &O, VPSlotTracker
&SlotTracker) const {
}
#endif
+VPBlockBase *VPBlockUtils::cloneCFG(
+VPBlockBase *Entry, DenseMap &Old2New,
+DenseMap &Old2NewVPValues, bool FullRemapping) {
+ ReversePostOrderTraversal>
@@ -2262,9 +2400,22 @@ class VPDerivedIVRecipe : public VPRecipeBase, public
VPValue {
VPValue(this), TruncResultTy(TruncResultTy), Kind(IndDesc.getKind()),
FPBinOp(dyn_cast_or_null(IndDesc.getInductionBinOp()))
{
}
fhahn wrote:
Updated, th
@@ -1200,6 +1271,59 @@ void VPUser::printOperands(raw_ostream &O, VPSlotTracker
&SlotTracker) const {
}
#endif
+VPBlockBase *VPBlockUtils::cloneCFG(
+VPBlockBase *Entry, DenseMap &Old2New,
+DenseMap &Old2NewVPValues, bool FullRemapping) {
+ ReversePostOrderTraversal>
@@ -615,6 +615,18 @@ void VPBasicBlock::print(raw_ostream &O, const Twine
&Indent,
}
#endif
+VPBlockBase *VPRegionBlock::clone() {
fhahn wrote:
Updated, thanks! Also removed `VPBlockBase::clone` and moved to static
functions, as without remapping it is not
@@ -2262,9 +2400,22 @@ class VPDerivedIVRecipe : public VPRecipeBase, public
VPValue {
VPValue(this), TruncResultTy(TruncResultTy), Kind(IndDesc.getKind()),
FPBinOp(dyn_cast_or_null(IndDesc.getInductionBinOp()))
{
}
+ VPDerivedIVRecipe(InductionDescriptor::
@@ -982,6 +994,65 @@ void VPlan::updateDominatorTree(DominatorTree *DT,
BasicBlock *LoopHeaderBB,
assert(DT->verify(DominatorTree::VerificationLevel::Fast));
}
+static void remapVPValues(VPBasicBlock *OldBB, VPBasicBlock *NewBB,
+ DenseMap &Old2NewV
@@ -982,6 +994,65 @@ void VPlan::updateDominatorTree(DominatorTree *DT,
BasicBlock *LoopHeaderBB,
assert(DT->verify(DominatorTree::VerificationLevel::Fast));
}
+static void remapVPValues(VPBasicBlock *OldBB, VPBasicBlock *NewBB,
+ DenseMap &Old2NewV
@@ -615,6 +615,18 @@ void VPBasicBlock::print(raw_ostream &O, const Twine
&Indent,
}
#endif
+VPBlockBase *VPRegionBlock::clone() {
+ DenseMap Old2New;
fhahn wrote:
Renamed, thanks!
https://github.com/llvm/llvm-project/pull/73158
___
@@ -2807,6 +2976,8 @@ class VPlan {
VPBasicBlock *getPreheader() { return Preheader; }
const VPBasicBlock *getPreheader() const { return Preheader; }
fhahn wrote:
Done, thanks!
https://github.com/llvm/llvm-project/pull/73158
_
@@ -982,6 +994,65 @@ void VPlan::updateDominatorTree(DominatorTree *DT,
BasicBlock *LoopHeaderBB,
assert(DT->verify(DominatorTree::VerificationLevel::Fast));
}
+static void remapVPValues(VPBasicBlock *OldBB, VPBasicBlock *NewBB,
+ DenseMap &Old2NewV
@@ -982,6 +994,65 @@ void VPlan::updateDominatorTree(DominatorTree *DT,
BasicBlock *LoopHeaderBB,
assert(DT->verify(DominatorTree::VerificationLevel::Fast));
}
+static void remapVPValues(VPBasicBlock *OldBB, VPBasicBlock *NewBB,
+ DenseMap &Old2NewV
@@ -982,6 +994,65 @@ void VPlan::updateDominatorTree(DominatorTree *DT,
BasicBlock *LoopHeaderBB,
assert(DT->verify(DominatorTree::VerificationLevel::Fast));
}
+static void remapVPValues(VPBasicBlock *OldBB, VPBasicBlock *NewBB,
+ DenseMap &Old2NewV
@@ -10078,7 +10078,7 @@ bool LoopVectorizePass::processLoop(Loop *L) {
EpilogueVectorizerMainLoop MainILV(L, PSE, LI, DT, TLI, TTI, AC, ORE,
EPI, &LVL, &CM, BFI, PSI, Checks);
-VPlan &BestMainPlan = LVP.getBestPlanFor(
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/78113
>From 36b085f21b76d7bf7c9965a86a09d1cef4fe9329 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Sun, 14 Jan 2024 14:13:08 +
Subject: [PATCH] [VPlan] Add new VPUniformPerUFRecipe, use for step
truncation.
Add
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/78113
>From 36b085f21b76d7bf7c9965a86a09d1cef4fe9329 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Sun, 14 Jan 2024 14:13:08 +
Subject: [PATCH 1/2] [VPlan] Add new VPUniformPerUFRecipe, use for step
truncation.
fhahn wrote:
> The VPUniformPerUFRecipe of the current patch deals only with casts, so best
> name it as such, at-least for now, and define it comparable to
> VPWidenCastRecipe. Perhaps VPScalarCastRecipe would work - it effectively
> serves Invariant values placed outside the loop that are Un
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/78113
>From 36b085f21b76d7bf7c9965a86a09d1cef4fe9329 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Sun, 14 Jan 2024 14:13:08 +
Subject: [PATCH 1/3] [VPlan] Add new VPUniformPerUFRecipe, use for step
truncation.
@@ -1338,6 +1339,34 @@ class VPWidenCastRecipe : public VPRecipeWithIRFlags {
Type *getResultType() const { return ResultTy; }
};
+/// VPScalarCastRecipe is a recipe o create scalar cast instructions.
+class VPScalarCastRecipe : public VPRecipeBase, public VPValue {
+ /// C
@@ -1338,6 +1339,34 @@ class VPWidenCastRecipe : public VPRecipeWithIRFlags {
Type *getResultType() const { return ResultTy; }
};
+/// VPScalarCastRecipe is a recipe o create scalar cast instructions.
+class VPScalarCastRecipe : public VPRecipeBase, public VPValue {
@@ -230,7 +230,11 @@ Type *VPTypeAnalysis::inferScalarType(const VPValue *V) {
return V->getUnderlyingValue()->getType();
})
.Case(
- [](const VPWidenCastRecipe *R) { return R->getResultType(); });
+ [](const VPWidenCast
@@ -1338,6 +1339,34 @@ class VPWidenCastRecipe : public VPRecipeWithIRFlags {
Type *getResultType() const { return ResultTy; }
};
+/// VPScalarCastRecipe is a recipe o create scalar cast instructions.
+class VPScalarCastRecipe : public VPRecipeBase, public VPValue {
+ /// C
@@ -1338,6 +1339,34 @@ class VPWidenCastRecipe : public VPRecipeWithIRFlags {
Type *getResultType() const { return ResultTy; }
};
+/// VPScalarCastRecipe is a recipe o create scalar cast instructions.
fhahn wrote:
Fixed, thanks!
https://github.com/llvm/llv
@@ -504,6 +504,15 @@ static VPValue *createScalarIVSteps(VPlan &Plan, const
InductionDescriptor &ID,
HeaderVPBB->insert(BaseIV->getDefiningRecipe(), IP);
}
+ VPTypeAnalysis TypeInfo(SE.getContext());
+ if (TypeInfo.inferScalarType(BaseIV) != TypeInfo.inferScalarType(S
@@ -1469,6 +1465,47 @@ void VPReplicateRecipe::print(raw_ostream &O, const
Twine &Indent,
}
#endif
+Value *VPScalarCastRecipe ::generate(VPTransformState &State, unsigned Part) {
+ assert(vputils::onlyFirstLaneUsed(this) &&
+ "Codegen only implemented for first lane
@@ -1338,6 +1339,34 @@ class VPWidenCastRecipe : public VPRecipeWithIRFlags {
Type *getResultType() const { return ResultTy; }
};
+/// VPScalarCastRecipe is a recipe o create scalar cast instructions.
+class VPScalarCastRecipe : public VPRecipeBase, public VPValue {
+ /// C
@@ -164,6 +164,8 @@ bool VPRecipeBase::mayHaveSideEffects() const {
auto *R = cast(this);
return R->getUnderlyingInstr()->mayHaveSideEffects();
}
+ case VPScalarCastSC:
+return false;
fhahn wrote:
moved, thanks!
https://github.com/llvm/llvm-pro
@@ -1469,6 +1465,47 @@ void VPReplicateRecipe::print(raw_ostream &O, const
Twine &Indent,
}
#endif
+Value *VPScalarCastRecipe ::generate(VPTransformState &State, unsigned Part) {
+ assert(vputils::onlyFirstLaneUsed(this) &&
+ "Codegen only implemented for first lane
@@ -362,6 +362,7 @@ class VPDef {
// START: Phi-like recipes. Need to be kept together.
VPBlendSC,
VPPredInstPHISC,
+VPScalarCastSC,
fhahn wrote:
Moved, thanks!
https://github.com/llvm/llvm-project/pull/78113
__
@@ -1117,13 +1119,7 @@ void VPScalarIVStepsRecipe::execute(VPTransformState
&State) {
// Ensure step has the same type as that of scalar IV.
Type *BaseIVTy = BaseIV->getType()->getScalarType();
- if (BaseIVTy != Step->getType()) {
-// TODO: Also use VPDerivedIVRecipe
@@ -1469,6 +1465,47 @@ void VPReplicateRecipe::print(raw_ostream &O, const
Twine &Indent,
}
#endif
+Value *VPScalarCastRecipe ::generate(VPTransformState &State, unsigned Part) {
+ assert(vputils::onlyFirstLaneUsed(this) &&
+ "Codegen only implemented for first lane
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/78113
>From 36b085f21b76d7bf7c9965a86a09d1cef4fe9329 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Sun, 14 Jan 2024 14:13:08 +
Subject: [PATCH 1/4] [VPlan] Add new VPUniformPerUFRecipe, use for step
truncation.
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/78632
>From a786cdedc2c9a9898cd0b80d84f5b11aace5da1c Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Tue, 28 Nov 2023 15:44:02 +
Subject: [PATCH 1/2] [AArch64] Add custom lowering for load <3 x i8>.
Add custom comb
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/78637
>From efd07e93aed51049ad3783c701284617ae446330 Mon Sep 17 00:00:00 2001
From: Florian Hahn
Date: Wed, 17 Jan 2024 11:11:59 +
Subject: [PATCH 1/2] [AArch64] Combine store (trunc X to <3 x i8>) to sequence
of ST1
201 - 300 of 637 matches
Mail list logo