File tree Expand file tree Collapse file tree 4 files changed +12
-14
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 4 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -2797,9 +2797,12 @@ class VPSingleDefBundleRecipe : public VPSingleDefRecipe {
2797
2797
return new VPSingleDefBundleRecipe (BundleType, NewBundledRecipes);
2798
2798
}
2799
2799
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
+ }
2803
2806
2804
2807
// / Insert the bundled recipes back into the VPlan, directly before the
2805
2808
// / current recipe. Leaves the bundle recipe empty, which must be removed
Original file line number Diff line number Diff line change @@ -269,14 +269,6 @@ Type *VPTypeAnalysis::inferScalarType(const VPValue *V) {
269
269
270
270
Type *ResultTy =
271
271
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
- })
280
272
.Case <VPActiveLaneMaskPHIRecipe, VPCanonicalIVPHIRecipe,
281
273
VPFirstOrderRecurrencePHIRecipe, VPReductionPHIRecipe,
282
274
VPWidenPointerInductionRecipe, VPEVLBasedIVPHIRecipe>(
@@ -311,6 +303,9 @@ Type *VPTypeAnalysis::inferScalarType(const VPValue *V) {
311
303
})
312
304
.Case <VPReductionRecipe>([this ](const auto *R) {
313
305
return inferScalarType (R->getChainOp ());
306
+ })
307
+ .Case <VPSingleDefBundleRecipe>([this ](const auto *R) {
308
+ return inferScalarType (R->getTypeVPValue ());
314
309
});
315
310
316
311
assert (ResultTy && " could not infer type for the given VPValue" );
Original file line number Diff line number Diff line change @@ -2608,7 +2608,7 @@ void VPSingleDefBundleRecipe::unbundle() {
2608
2608
for (const auto &[Idx, Op] : enumerate(operands ()))
2609
2609
BundleLiveInPlaceholders[Idx]->replaceAllUsesWith (Op);
2610
2610
2611
- replaceAllUsesWith (getResultRecipe ());
2611
+ replaceAllUsesWith (BundledRecipes. back ());
2612
2612
BundledRecipes.clear ();
2613
2613
}
2614
2614
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ namespace llvm {
32
32
// Forward declarations.
33
33
class raw_ostream ;
34
34
class Value ;
35
- class VPBundleRecipe ;
35
+ class VPSinglDefBundleRecipe ;
36
36
class VPDef ;
37
37
struct VPDoubleValueDef ;
38
38
class VPSlotTracker ;
@@ -50,7 +50,7 @@ class VPValue {
50
50
friend struct VPDoubleValueDef ;
51
51
friend class VPInterleaveRecipe ;
52
52
friend class VPlan ;
53
- friend class VPBundleRecipe ;
53
+ friend class VPSingleDefBundleRecipe ;
54
54
55
55
const unsigned char SubclassID; // /< Subclass identifier (for isa/dyn_cast).
56
56
You can’t perform that action at this time.
0 commit comments