[PATCH] D88819: [LV] Support for Remainder loop vectorization

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 07:40:57 PDT 2020


bmahjour added a comment.

Thanks for working on epilogue vectorization. Incidentally I've also looked into this recently. There has been a long and detailed discussion on the mailing list from back in 2017 about this transformation here http://llvm.1065342.n5.nabble.com/llvm-dev-Proposal-RFC-Epilog-loop-vectorization-td106322.html. Your patch is able to vectorize epilogue loops with fairly small changes to the LV, however the generated CFG is not optimal. For example, while the SCEV and memory checks are not redundantly executed, they are statically duplicated in the code and increase code size unnecessarily. The trip count checks can also be generated in a way that shortens the critical path from the checks to the scalar loop, which is critical for loops that have a small trip count. Based on the followup discussions from the mentioned RFC, the optimal CFG should look more like what I've attached below.

F13180829: Screen Shot 2020-10-06 at 10.16.04 AM.png <https://reviews.llvm.org/F13180829>


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88819/new/

https://reviews.llvm.org/D88819



More information about the llvm-commits mailing list