[VPlan] Don't compute costs if there are no vector VPlans.
In some cases, no vector VPlans can be constructed due to failing VPlan legality checks (e.g. unable to perform sinking for first order recurrences or plans being incompatible with EVL). There's no need to compute costs in those cases, so check directly if there are no vector plans.
This commit is contained in:
@@ -7294,7 +7294,8 @@ LoopVectorizationPlanner::plan(ElementCount UserVF, unsigned UserIC) {
|
||||
buildVPlansWithVPRecipes(ElementCount::getScalable(1), MaxFactors.ScalableVF);
|
||||
|
||||
LLVM_DEBUG(printPlans(dbgs()));
|
||||
if (!MaxFactors.hasVector())
|
||||
if (all_of(VPlans,
|
||||
[](std::unique_ptr<VPlan> &P) { return P->hasScalarVFOnly(); }))
|
||||
return VectorizationFactor::Disabled();
|
||||
|
||||
// Select the optimal vectorization factor.
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
; REQUIRES: asserts
|
||||
|
||||
; Make sure we do not vectorize a loop with a widened int induction.
|
||||
; TODO: There's no need to compute costs for any VF, as no VPlans have been generated.
|
||||
define void @test_wide_integer_induction(ptr noalias %a, i64 %N) {
|
||||
; CHECK: LV: Vector loop of width {{.+}} costs:
|
||||
; CHECK-NOT: LV: Vector loop of width {{.+}} costs:
|
||||
;
|
||||
; CHECK: define void @test_wide_integer_induction(
|
||||
; CHECK-NOT: vector.body
|
||||
|
||||
Reference in New Issue
Block a user