[LV] Reuse SCEV expansion results for epilogue vectorization.
authorFlorian Hahn <flo@fhahn.com>
Thu, 11 May 2023 21:00:06 +0000 (22:00 +0100)
committerFlorian Hahn <flo@fhahn.com>
Thu, 11 May 2023 21:00:07 +0000 (22:00 +0100)
commit3d4eed01338d3b5f0bb5b2dbe41afc9d957d3cc6
tree06da1e1bee22d1805e82b748acdb2d5a9e4a0777
parent0330ac2d3e5a95b4b98c84d2bc8a77768c7a679c
[LV] Reuse SCEV expansion results for epilogue vectorization.

When generating code for the epilogue vector loop, we need to re-use the
expansion results for induction steps generated for the main vector
loop, as the pre-header of the epilogue vector loop may not dominate the
vector preheader of the epilogue.

This fixes a reported crash. Note that this is a workaround which should
be removed soon once induction resume value creation is handled in VPlan
directly.
llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/X86/epilog-vectorization-inductions.ll