[all-commits] [llvm/llvm-project] 17b9cb: [runtimeunroll] Support multiple exits to latch ex...

Philip Reames via All-commits all-commits at lists.llvm.org
Thu Aug 19 11:44:07 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 17b9cb181775e47fb986dae45e2e2a38b84e33cf
      https://github.com/llvm/llvm-project/commit/17b9cb181775e47fb986dae45e2e2a38b84e33cf
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2021-08-19 (Thu, 19 Aug 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
    M llvm/test/Transforms/LoopUnroll/runtime-loop-multiple-exits.ll

  Log Message:
  -----------
  [runtimeunroll] Support multiple exits to latch exit w/prolog loop

This patch extends the runtime unrolling infrastructure to support unrolling a loop with multiple exiting blocks branching to the same exit block used by the latch. It intentionally does not include a cost model change to enable this functionality unless appropriate force flags are used.

This is the prolog companion to D107381. Since this was LGTMed, a problem with DT updating was reported against that patch.  I roled in the analogous fix here as it seemed obvious, and not worth re-review.

As an aside, our prolog form leaves a lot of potential value on the floor when there is an invariant load or invariant condition in the loop being runtime unrolled. We should probably consider a "required prolog" heuristic.  (Alternatively, maybe we should be peeling these cases more aggressively?)

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




More information about the All-commits mailing list