[PATCH] D126680: [VPlan] Replace BranchOnCount with BranchOnCond if TC <= UF * VF.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 1 05:52:55 PDT 2022


fhahn added a comment.

In D126680#3623434 <https://reviews.llvm.org/D126680#3623434>, @aeubanks wrote:

> this seems to be causing a miscompile, see https://github.com/llvm/llvm-project/issues/56319

Thanks, the issue is that in some cases with epilogue vectorization the main vector loop is effectively dead because we need to execute at least one iteration of the scalar loop, e.g. due to interleave groups. If the same plan is re-used for both the main vector loop and the epilogue vector loop, then the re-used plan has been optimized in a way that doesn't apply to the epilogue loop.

I pushed 0dddf04caba5 <https://reviews.llvm.org/rG0dddf04caba55a64f8534518d65311bdac05cf39>, which disables the optimization when doing epilogue vectorization. I'll also work on a better fix, which is to have 2 separate plans for the different loops, which avoids the problem by construction.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126680



More information about the llvm-commits mailing list