@@ -74,10 +74,9 @@ void VPlanTransforms::VPInstructionsToVPRecipes(
74
74
} else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) {
75
75
NewRecipe = new VPWidenGEPRecipe (GEP, Ingredient.operands ());
76
76
} else if (CallInst *CI = dyn_cast<CallInst>(Inst)) {
77
- NewRecipe =
78
- new VPWidenCallRecipe (CI, Ingredient.operands (),
79
- getVectorIntrinsicIDForCall (CI, &TLI),
80
- CI->getType (), CI->getDebugLoc ());
77
+ NewRecipe = new VPWidenCallRecipe (
78
+ CI, Ingredient.operands (), getVectorIntrinsicIDForCall (CI, &TLI),
79
+ CI->getType (), CI->getDebugLoc ());
81
80
} else if (SelectInst *SI = dyn_cast<SelectInst>(Inst)) {
82
81
NewRecipe = new VPWidenSelectRecipe (*SI, Ingredient.operands ());
83
82
} else if (auto *CI = dyn_cast<CastInst>(Inst)) {
@@ -1050,7 +1049,9 @@ void VPlanTransforms::truncateToMinimalBitwidths(
1050
1049
1051
1050
// Shrink operands by introducing truncates as needed.
1052
1051
unsigned StartIdx = isa<VPWidenSelectRecipe>(&R) ? 1 : 0 ;
1053
- for (unsigned Idx = StartIdx; Idx != R.getNumOperands (); ++Idx) {
1052
+ unsigned EndIdx =
1053
+ R.getNumOperands () - (isa<VPWidenCallRecipe>(&R) ? 1 : 0 );
1054
+ for (unsigned Idx = StartIdx; Idx != EndIdx; ++Idx) {
1054
1055
auto *Op = R.getOperand (Idx);
1055
1056
unsigned OpSizeInBits =
1056
1057
TypeInfo.inferScalarType (Op)->getScalarSizeInBits ();
0 commit comments