[llvm] 8bd02e5 - [VPlan] Assert instead checking if VF is vec when widening calls (NFC)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri May 5 10:25:00 PDT 2023
Author: Florian Hahn
Date: 2023-05-05T18:21:57+01:00
New Revision: 8bd02e5aefa84e41afa3b2897581c3147b212e3b
URL: https://github.com/llvm/llvm-project/commit/8bd02e5aefa84e41afa3b2897581c3147b212e3b
DIFF: https://github.com/llvm/llvm-project/commit/8bd02e5aefa84e41afa3b2897581c3147b212e3b.diff
LOG: [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.
Added:
Modified:
llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index 77031a92a5dc..82cd7e91e345 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())) {
More information about the llvm-commits
mailing list