[all-commits] [llvm/llvm-project] 28865d: [LSR][term-fold] Adjust expansion budget based on ...

Philip Reames via All-commits all-commits at lists.llvm.org
Fri Feb 2 08:57:38 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 28865da37451904c4654f20cdaddee815fdeff1d
      https://github.com/llvm/llvm-project/commit/28865da37451904c4654f20cdaddee815fdeff1d
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2024-02-02 (Fri, 02 Feb 2024)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
    M llvm/test/Transforms/LoopStrengthReduce/lsr-term-fold.ll

  Log Message:
  -----------
  [LSR][term-fold] Adjust expansion budget based on trip count (#80304)

Follow up to https://github.com/llvm/llvm-project/pull/74747

This change extends the previously added fixed expansion threshold by
scaling down the cost allowed for an expansion for a loop with either a
small known trip count or a profile which indicates the trip count is
likely small. The goal here is to improve code generation for a loop
nest where the outer loop has a high trip count, and the inner loop runs
only a handful of iterations.

---------

Co-authored-by: Nikita Popov <github at npopov.com>




More information about the All-commits mailing list