[all-commits] [llvm/llvm-project] e49d65: [LV] Fix bug when unrolling (only) a loop with non...

Philip Reames via All-commits all-commits at lists.llvm.org
Tue Jun 29 08:04:45 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e49d65f36d66e247c148601f59edeb2e0b44d8dd
      https://github.com/llvm/llvm-project/commit/e49d65f36d66e247c148601f59edeb2e0b44d8dd
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/test/Transforms/LoopVectorize/unroll_nonlatch.ll

  Log Message:
  -----------
  [LV] Fix bug when unrolling (only) a loop with non-latch exit

If we unroll a loop in the vectorizer (without vectorizing), and the cost model requires a epilogue be generated for correctness, the code generation must actually do so.

The included test case on an unmodified opt will access memory one past the expected bound.  As a result, this patch is fixing a latent miscompile.

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




More information about the All-commits mailing list