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

RosieSumpter via All-commits all-commits at lists.llvm.org
Mon Aug 2 03:18:03 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f117ed542fd2c327924d7767268d75ce77559944
      https://github.com/llvm/llvm-project/commit/f117ed542fd2c327924d7767268d75ce77559944
  Author: Rosie Sumpter <rosie.sumpter at arm.com>
  Date:   2021-08-02 (Mon, 02 Aug 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 limit of the inner loop is a known integer, 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