[all-commits] [llvm/llvm-project] 1ae266: [LoopUnroll] Use smallest exact trip count from an...

Nikita Popov via All-commits all-commits at lists.llvm.org
Sun Jun 20 12:01:53 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1ae266f4529fe17c11331f11db74428b879f3737
      https://github.com/llvm/llvm-project/commit/1ae266f4529fe17c11331f11db74428b879f3737
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-06-20 (Sun, 20 Jun 2021)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
    M llvm/test/Transforms/LoopUnroll/full-unroll-one-unpredictable-exit.ll
    M llvm/test/Transforms/LoopUnroll/multiple-exits.ll
    M llvm/test/Transforms/LoopUnroll/partial-unroll-non-latch-exit.ll
    M llvm/test/Transforms/LoopUnroll/runtime-loop-known-exit.ll
    M llvm/test/Transforms/LoopUnroll/scevunroll.ll
    M llvm/test/Transforms/LoopUnroll/unloop.ll
    M llvm/test/Transforms/LoopUnroll/unroll-header-exiting-with-phis-multiple-exiting-blocks.ll

  Log Message:
  -----------
  [LoopUnroll] Use smallest exact trip count from any exit

This is a more general alternative/extension to D102635. Rather than
handling the special case of "header exit with non-exiting latch",
this unrolls against the smallest exact trip count from any exit.
The latch exit is no longer treated as priviledged when it comes to
full unrolling.

The motivating case is in full-unroll-one-unpredictable-exit.ll.
Here the header exit is an IV-based exit, while the latch exit is
a data comparison. This kind of loop does not get rotated, because
the latch is already exiting, and loop rotation doesn't try to
distinguish IV-based/analyzable latches.

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




More information about the All-commits mailing list