diff options
author | Florian Hahn <flo@fhahn.com> | 2023-05-05 18:21:56 +0100 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2023-05-05 18:21:57 +0100 |
commit | 8bd02e5aefa84e41afa3b2897581c3147b212e3b (patch) | |
tree | de49287d7881840b984d3a8f2c4b087597d5df08 | |
parent | f9fa8a59970451ffd9ffc6b4c0554c7e7bd25ab0 (diff) | |
download | llvm-8bd02e5aefa84e41afa3b2897581c3147b212e3b.zip llvm-8bd02e5aefa84e41afa3b2897581c3147b212e3b.tar.gz llvm-8bd02e5aefa84e41afa3b2897581c3147b212e3b.tar.bz2 |
[VPlan] Assert instead checking if VF is vec when widening calls (NFC)
VPWidenCallRecipe should not be generated for scalar VFs. Replace check
with an assert.
-rw-r--r-- | llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp index 77031a9..82cd7e9 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp @@ -478,6 +478,7 @@ void VPInstruction::setFastMathFlags(FastMathFlags FMFNew) { } void VPWidenCallRecipe::execute(VPTransformState &State) { + assert(State.VF.isVector() && "not widening"); auto &CI = *cast<CallInst>(getUnderlyingInstr()); assert(!isa<DbgInfoIntrinsic>(CI) && "DbgInfoIntrinsic should have been dropped during VPlan construction"); @@ -488,9 +489,7 @@ void VPWidenCallRecipe::execute(VPTransformState &State) { // Add return type if intrinsic is overloaded on it. if (isVectorIntrinsicWithOverloadTypeAtArg(VectorIntrinsicID, -1)) { TysForDecl.push_back( - State.VF.isVector() - ? VectorType::get(CI.getType()->getScalarType(), State.VF) - : CI.getType()); + VectorType::get(CI.getType()->getScalarType(), State.VF)); } SmallVector<Value *, 4> Args; for (const auto &I : enumerate(operands())) { |