@@ -545,7 +545,6 @@ class VPSingleDefRecipe : public VPRecipeBase, public VPValue {
545545 case VPRecipeBase::VPWidenIntrinsicSC:
546546 case VPRecipeBase::VPWidenSC:
547547 case VPRecipeBase::VPWidenSelectSC:
548- case VPRecipeBase::VPBlendSC:
549548 case VPRecipeBase::VPPredInstPHISC:
550549 case VPRecipeBase::VPCanonicalIVPHISC:
551550 case VPRecipeBase::VPActiveLaneMaskPHISC:
@@ -2369,72 +2368,6 @@ class VPReductionPHIRecipe : public VPHeaderPHIRecipe,
23692368 }
23702369};
23712370
2372- // / A recipe for vectorizing a phi-node as a sequence of mask-based select
2373- // / instructions.
2374- class LLVM_ABI_FOR_TEST VPBlendRecipe : public VPSingleDefRecipe {
2375- public:
2376- // / The blend operation is a User of the incoming values and of their
2377- // / respective masks, ordered [I0, M0, I1, M1, I2, M2, ...]. Note that M0 can
2378- // / be omitted (implied by passing an odd number of operands) in which case
2379- // / all other incoming values are merged into it.
2380- VPBlendRecipe (PHINode *Phi, ArrayRef<VPValue *> Operands, DebugLoc DL)
2381- : VPSingleDefRecipe(VPDef::VPBlendSC, Operands, Phi, DL) {
2382- assert (Operands.size () > 0 && " Expected at least one operand!" );
2383- }
2384-
2385- VPBlendRecipe *clone () override {
2386- return new VPBlendRecipe (cast_or_null<PHINode>(getUnderlyingValue ()),
2387- operands (), getDebugLoc ());
2388- }
2389-
2390- VP_CLASSOF_IMPL (VPDef::VPBlendSC)
2391-
2392- // / A normalized blend is one that has an odd number of operands, whereby the
2393- // / first operand does not have an associated mask.
2394- bool isNormalized () const { return getNumOperands () % 2 ; }
2395-
2396- // / Return the number of incoming values, taking into account when normalized
2397- // / the first incoming value will have no mask.
2398- unsigned getNumIncomingValues () const {
2399- return (getNumOperands () + isNormalized ()) / 2 ;
2400- }
2401-
2402- // / Return incoming value number \p Idx.
2403- VPValue *getIncomingValue (unsigned Idx) const {
2404- return Idx == 0 ? getOperand (0 ) : getOperand (Idx * 2 - isNormalized ());
2405- }
2406-
2407- // / Return mask number \p Idx.
2408- VPValue *getMask (unsigned Idx) const {
2409- assert ((Idx > 0 || !isNormalized ()) && " First index has no mask!" );
2410- return Idx == 0 ? getOperand (1 ) : getOperand (Idx * 2 + !isNormalized ());
2411- }
2412-
2413- void execute (VPTransformState &State) override {
2414- llvm_unreachable (" VPBlendRecipe should be expanded by simplifyBlends" );
2415- }
2416-
2417- // / Return the cost of this VPWidenMemoryRecipe.
2418- InstructionCost computeCost (ElementCount VF,
2419- VPCostContext &Ctx) const override ;
2420-
2421- #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
2422- // / Print the recipe.
2423- void print (raw_ostream &O, const Twine &Indent,
2424- VPSlotTracker &SlotTracker) const override ;
2425- #endif
2426-
2427- // / Returns true if the recipe only uses the first lane of operand \p Op.
2428- bool onlyFirstLaneUsed (const VPValue *Op) const override {
2429- assert (is_contained (operands (), Op) &&
2430- " Op must be an operand of the recipe" );
2431- // Recursing through Blend recipes only, must terminate at header phi's the
2432- // latest.
2433- return all_of (users (),
2434- [this ](VPUser *U) { return U->onlyFirstLaneUsed (this ); });
2435- }
2436- };
2437-
24382371// / VPInterleaveRecipe is a recipe for transforming an interleave group of load
24392372// / or stores into one wide load/store and shuffles. The first operand of a
24402373// / VPInterleave recipe is the address, followed by the stored values, followed
0 commit comments