[all-commits] [llvm/llvm-project] c7b25e: [LoopDeletion] Use max trip count to break backedg...

Philip Reames via All-commits all-commits at lists.llvm.org
Fri Aug 27 14:24:48 PDT 2021


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

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopDeletion.cpp
    M llvm/test/Transforms/LoopDeletion/switch.ll
    M llvm/test/Transforms/LoopDeletion/zero-btc.ll

  Log Message:
  -----------
  [LoopDeletion] Use max trip count to break backedge in addition to exact one

We'd added support a while back from breaking the backedge if SCEV can prove the trip count is zero. However, we used the exact trip count which requires *all* exits be analyzeable. I noticed while writing test cases for another patch that this disallows cases where one exit is provably taken paired with another which is unknown. This patch adds the upper bound case.

We could use a symbolic max trip count here instead, but we use an isKnownNonZero filter (presumably for compile time?) for the first-iteration reasoning. I decided this was a more obvious incremental step, and we could go back and untangle the schemes separately.

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




More information about the All-commits mailing list