Skip to content

Commit 4dd7033

Browse files
fhahnrlavaee
authored andcommitted
[VPlan] Infer reduction result types w/o accessing underlying phis.(NFC)
Remove another use of the underlying IR phi.
1 parent 2b7cbe5 commit 4dd7033

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,10 @@ Type *VPTypeAnalysis::inferScalarTypeForRecipe(const VPInstruction *R) {
9191
"different types inferred for different operands");
9292
return IntegerType::get(Ctx, 1);
9393
case VPInstruction::ComputeAnyOfResult:
94+
return inferScalarType(R->getOperand(1));
9495
case VPInstruction::ComputeFindIVResult:
9596
case VPInstruction::ComputeReductionResult: {
96-
auto *PhiR = cast<VPReductionPHIRecipe>(R->getOperand(0));
97-
auto *OrigPhi = cast<PHINode>(PhiR->getUnderlyingValue());
98-
return OrigPhi->getType();
97+
return inferScalarType(R->getOperand(0));
9998
}
10099
case VPInstruction::ExplicitVectorLength:
101100
return Type::getIntNTy(Ctx, 32);

0 commit comments

Comments
 (0)