Skip to content

Commit 29712cc

Browse files
committed
[VPlan] Assert instead of check if VF is vector when widening casts.
VPWidenRecipes should not be generated for scalar VFs. Replace check with an assert. Suggested in preparation for D149081.
1 parent 62d7d94 commit 29712cc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -701,9 +701,8 @@ void VPWidenRecipe::execute(VPTransformState &State) {
701701
State.setDebugLocFromInst(CI);
702702

703703
/// Vectorize casts.
704-
Type *DestTy = (State.VF.isScalar())
705-
? CI->getType()
706-
: VectorType::get(CI->getType(), State.VF);
704+
assert(State.VF.isVector() && "not widening");
705+
Type *DestTy = VectorType::get(CI->getType(), State.VF);
707706

708707
for (unsigned Part = 0; Part < State.UF; ++Part) {
709708
Value *A = State.get(getOperand(0), Part);

0 commit comments

Comments
 (0)