[all-commits] [llvm/llvm-project] 2df8bf: [LoopFlatten] Fix missed LoopFlatten opportunity

RosieSumpter via All-commits all-commits at lists.llvm.org
Thu Jul 29 01:53:35 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2df8bf9339e43de63d8d28e07182e1d6d7ffb843
      https://github.com/llvm/llvm-project/commit/2df8bf9339e43de63d8d28e07182e1d6d7ffb843
  Author: Rosie Sumpter <rosie.sumpter at arm.com>
  Date:   2021-07-29 (Thu, 29 Jul 2021)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopFlatten.cpp
    M llvm/test/Transforms/LoopFlatten/loop-flatten-negative.ll
    M llvm/test/Transforms/LoopFlatten/loop-flatten.ll

  Log Message:
  -----------
  [LoopFlatten] Fix missed LoopFlatten opportunity

When the trip count of the inner loop is a constant, the InstCombine
pass now causes the transformation e.g. imcp ult i32 %inc, tripcount ->
icmp ult %j, tripcount-step (where %j is the inner loop induction
variable and %inc is add %j, step), which is now accounted for when
identifying the trip count of the loop. This is also an acceptable use
of %j (provided the step is 1) so is ignored as long as the compare
that it's used in is also the condition of the inner branch.

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




More information about the All-commits mailing list