@@ -907,7 +907,6 @@ class VPSingleDefRecipe : public VPRecipeBase, public VPValue {
907907 case VPRecipeBase::VPReplicateSC:
908908 case VPRecipeBase::VPScalarIVStepsSC:
909909 case VPRecipeBase::VPVectorPointerSC:
910- case VPRecipeBase::VPWidenCallSC:
911910 case VPRecipeBase::VPWidenCanonicalIVSC:
912911 case VPRecipeBase::VPWidenCastSC:
913912 case VPRecipeBase::VPWidenGEPSC:
@@ -929,6 +928,7 @@ class VPSingleDefRecipe : public VPRecipeBase, public VPValue {
929928 case VPRecipeBase::VPBranchOnMaskSC:
930929 case VPRecipeBase::VPInterleaveSC:
931930 case VPRecipeBase::VPIRInstructionSC:
931+ case VPRecipeBase::VPWidenCallSC:
932932 case VPRecipeBase::VPWidenLoadEVLSC:
933933 case VPRecipeBase::VPWidenLoadSC:
934934 case VPRecipeBase::VPWidenStoreEVLSC:
@@ -1734,28 +1734,35 @@ class VPWidenIntrinsicRecipe : public VPSingleDefRecipeWithIRFlags {
17341734};
17351735
17361736// / A recipe for widening Call instructions using library calls.
1737- class VPWidenCallRecipe : public VPSingleDefRecipeWithIRFlags {
1737+ class VPWidenCallRecipe : public VPRecipeBase , public VPRecipeIRFlags {
17381738 // / Variant stores a pointer to the chosen function. There is a 1:1 mapping
17391739 // / between a given VF and the chosen vectorized variant, so there will be a
17401740 // / different VPlan for each VF with a valid variant.
17411741 Function *Variant;
17421742
1743+ CallInst *CI;
1744+
17431745public:
1744- VPWidenCallRecipe (Value *UV , Function *Variant,
1746+ VPWidenCallRecipe (CallInst *CI , Function *Variant,
17451747 ArrayRef<VPValue *> CallArguments, DebugLoc DL = {})
1746- : VPSingleDefRecipeWithIRFlags(VPDef::VPWidenCallSC, CallArguments,
1747- *cast<Instruction>(UV)),
1748- Variant (Variant) {
1748+ : VPRecipeBase(VPDef::VPWidenCallSC, CallArguments, DL),
1749+ VPRecipeIRFlags (*CI), Variant(Variant), CI(CI) {
17491750 assert (
17501751 isa<Function>(getOperand (getNumOperands () - 1 )->getLiveInIRValue ()) &&
17511752 " last operand must be the called function" );
1753+ for (Type *Ty : getContainedTypes (CI->getType ())) {
1754+ (void )Ty;
1755+ new VPValue (CI, this );
1756+ }
17521757 }
17531758
1759+ CallInst *getUnderlyingCallInstruction () const { return CI; }
1760+
17541761 ~VPWidenCallRecipe () override = default ;
17551762
17561763 VPWidenCallRecipe *clone () override {
1757- return new VPWidenCallRecipe (getUnderlyingValue (), Variant ,
1758- { op_begin (), op_end ()}, getDebugLoc ());
1764+ return new VPWidenCallRecipe (CI, Variant, { op_begin (), op_end ()} ,
1765+ getDebugLoc ());
17591766 }
17601767
17611768 VP_CLASSOF_IMPL (VPDef::VPWidenCallSC)
0 commit comments