Skip to content

Commit 7ee7768

Browse files
committed
fixup! [VPlan][LoopVectorize] Truncate min/max intrinsic ops
1 parent 9b24ba5 commit 7ee7768

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,9 @@ void VPlanTransforms::VPInstructionsToVPRecipes(
7474
} else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) {
7575
NewRecipe = new VPWidenGEPRecipe(GEP, Ingredient.operands());
7676
} 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());
8180
} else if (SelectInst *SI = dyn_cast<SelectInst>(Inst)) {
8281
NewRecipe = new VPWidenSelectRecipe(*SI, Ingredient.operands());
8382
} else if (auto *CI = dyn_cast<CastInst>(Inst)) {
@@ -1050,7 +1049,9 @@ void VPlanTransforms::truncateToMinimalBitwidths(
10501049

10511050
// Shrink operands by introducing truncates as needed.
10521051
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) {
10541055
auto *Op = R.getOperand(Idx);
10551056
unsigned OpSizeInBits =
10561057
TypeInfo.inferScalarType(Op)->getScalarSizeInBits();

0 commit comments

Comments
 (0)