From 29712ccda62012e615b8c55bc6a3fa7454c10c42 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Fri, 5 May 2023 09:02:32 +0100 Subject: [PATCH] [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. --- llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp index 849f3f8..4f3e527 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp @@ -701,9 +701,8 @@ void VPWidenRecipe::execute(VPTransformState &State) { State.setDebugLocFromInst(CI); /// Vectorize casts. - Type *DestTy = (State.VF.isScalar()) - ? CI->getType() - : VectorType::get(CI->getType(), State.VF); + assert(State.VF.isVector() && "not widening"); + Type *DestTy = VectorType::get(CI->getType(), State.VF); for (unsigned Part = 0; Part < State.UF; ++Part) { Value *A = State.get(getOperand(0), Part); -- 2.7.4