[LV] Epilogue Vectorization with Optimal Control Flow (Recommit)

Authored by bmahjour on Dec 2 2020, 7:07 AM.


[LV] Epilogue Vectorization with Optimal Control Flow (Recommit)

This is yet another attempt at providing support for epilogue
vectorization following discussions raised in RFC http://llvm.1065342.n5.nabble.com/llvm-dev-Proposal-RFC-Epilog-loop-vectorization-tt106322.html#none
and reviews D30247 and D88819.

Similar to D88819, this patch achieve epilogue vectorization by
executing a single vplan twice: once on the main loop and a second
time on the epilogue loop (using a different VF). However it's able
to handle more loops, and generates more optimal control flow for
cases where the trip count is too small to execute any code in vector

Reviewed By: SjoerdMeijer

Differential Revision: https://reviews.llvm.org/D89566