[VPlan] Make sure optimizeInductions removes wide ind from scalar plan.
authorFlorian Hahn <flo@fhahn.com>
Thu, 30 Jun 2022 08:08:33 +0000 (09:08 +0100)
committerFlorian Hahn <flo@fhahn.com>
Thu, 30 Jun 2022 08:11:48 +0000 (09:11 +0100)
commit24b5f8e0d0bd6851e01dbe2de4c71df4b3b0760b
tree131bb4a5b0f3d73bfdffdafd5ca427ca0401fce7
parent06d103ff9553197f6d4d545366f4fa2996a82a10
[VPlan] Make sure optimizeInductions removes wide ind from scalar plan.

In some cases, there may be widened users of inductions even though the
plan includes the scalar VF. In those cases, make sure we still replace
the VPWidenIntOrFpInductionRecipe with scalar steps, as otherwise we may
try to execute a VPWidenIntOrFpInductionRecipe with a scalar VF.

Alternatively the patch could also split the range if needed.

This fixes a crash exposed by D123720.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D128755
llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
llvm/test/Transforms/LoopVectorize/interleave-and-scalarize-only.ll