[all-commits] [llvm/llvm-project] 2f6987: [LoopRotate] add ability to repeat loop rotation u...

Fedor Sergeev via All-commits all-commits at lists.llvm.org
Thu Jan 23 05:30:21 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2f6987ba61cc31c16c64f511e5cbc76b52dc67b3
      https://github.com/llvm/llvm-project/commit/2f6987ba61cc31c16c64f511e5cbc76b52dc67b3
  Author: Fedor Sergeev <fedor.sergeev at azul.com>
  Date:   2020-01-23 (Thu, 23 Jan 2020)

  Changed paths:
    M llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
    A llvm/test/Transforms/LoopRotate/multiple-deopt-exits.ll
    M llvm/unittests/Transforms/Utils/CMakeLists.txt
    A llvm/unittests/Transforms/Utils/LoopRotationUtilsTest.cpp

  Log Message:
  -----------
  [LoopRotate] add ability to repeat loop rotation until non-deoptimizing exit is found

In case of loops with multiple exit where all-but-one exit are deoptimizing
it might happen that the first rotation will end up with latch having a deoptimizing
exit. This makes the loop unsuitable for trip-count analysis (say, getLoopEstimatedTripCount)
as well as for loop transformations that know how to handle multple deoptimizing exits.

It pretty much means that canonical form in multple-deoptimizing-exits case should be
with non-deoptimizing exit at latch.
Teach loop-rotation to reach this canonical form by repeating rotation.

-loop-rotate-multi option introduced to control this behavior, currently disabled by default.

Reviewers: skatkov, asbirlea, reames, fhahn
Reviewed By: skatkov

Tags: #llvm

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




More information about the All-commits mailing list