Skip to content

Commit 42359e5

Browse files
committed
!fixup continue renaming
1 parent 1bae34e commit 42359e5

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,9 +2797,12 @@ class VPSingleDefBundleRecipe : public VPSingleDefRecipe {
27972797
return new VPSingleDefBundleRecipe(BundleType, NewBundledRecipes);
27982798
}
27992799

2800-
/// Return the VPSingleDefRecipe producing the final result of the bundled
2801-
/// recipe.
2802-
VPSingleDefRecipe *getResultRecipe() const { return BundledRecipes.back(); }
2800+
/// Return the VPValue to use to infer the result type of the recipe.
2801+
VPValue *getTypeVPValue() const {
2802+
unsigned OpIdx =
2803+
cast<VPReductionRecipe>(BundledRecipes.back())->isConditional() ? 2 : 1;
2804+
return getOperand(getNumOperands() - OpIdx);
2805+
}
28032806

28042807
/// Insert the bundled recipes back into the VPlan, directly before the
28052808
/// current recipe. Leaves the bundle recipe empty, which must be removed

llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,6 @@ Type *VPTypeAnalysis::inferScalarType(const VPValue *V) {
269269

270270
Type *ResultTy =
271271
TypeSwitch<const VPRecipeBase *, Type *>(V->getDefiningRecipe())
272-
.Case<VPBundleRecipe>([this](const auto *R) {
273-
unsigned RdxOpIdxOffset =
274-
cast<VPReductionRecipe>(R->getResultRecipe())->isConditional()
275-
? 2
276-
: 1;
277-
return inferScalarType(
278-
R->getOperand(R->getNumOperands() - RdxOpIdxOffset));
279-
})
280272
.Case<VPActiveLaneMaskPHIRecipe, VPCanonicalIVPHIRecipe,
281273
VPFirstOrderRecurrencePHIRecipe, VPReductionPHIRecipe,
282274
VPWidenPointerInductionRecipe, VPEVLBasedIVPHIRecipe>(
@@ -311,6 +303,9 @@ Type *VPTypeAnalysis::inferScalarType(const VPValue *V) {
311303
})
312304
.Case<VPReductionRecipe>([this](const auto *R) {
313305
return inferScalarType(R->getChainOp());
306+
})
307+
.Case<VPSingleDefBundleRecipe>([this](const auto *R) {
308+
return inferScalarType(R->getTypeVPValue());
314309
});
315310

316311
assert(ResultTy && "could not infer type for the given VPValue");

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2608,7 +2608,7 @@ void VPSingleDefBundleRecipe::unbundle() {
26082608
for (const auto &[Idx, Op] : enumerate(operands()))
26092609
BundleLiveInPlaceholders[Idx]->replaceAllUsesWith(Op);
26102610

2611-
replaceAllUsesWith(getResultRecipe());
2611+
replaceAllUsesWith(BundledRecipes.back());
26122612
BundledRecipes.clear();
26132613
}
26142614

llvm/lib/Transforms/Vectorize/VPlanValue.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace llvm {
3232
// Forward declarations.
3333
class raw_ostream;
3434
class Value;
35-
class VPBundleRecipe;
35+
class VPSinglDefBundleRecipe;
3636
class VPDef;
3737
struct VPDoubleValueDef;
3838
class VPSlotTracker;
@@ -50,7 +50,7 @@ class VPValue {
5050
friend struct VPDoubleValueDef;
5151
friend class VPInterleaveRecipe;
5252
friend class VPlan;
53-
friend class VPBundleRecipe;
53+
friend class VPSingleDefBundleRecipe;
5454

5555
const unsigned char SubclassID; ///< Subclass identifier (for isa/dyn_cast).
5656

0 commit comments

Comments
 (0)