[all-commits] [llvm/llvm-project] f8c2c4: [LSR] Account for hardware loop instructions (#147...

John Brawn via All-commits all-commits at lists.llvm.org
Mon Jul 14 08:49:16 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f8c2c4f161a6a98f623a6263a248fb24927eeaec
      https://github.com/llvm/llvm-project/commit/f8c2c4f161a6a98f623a6263a248fb24927eeaec
  Author: John Brawn <john.brawn at arm.com>
  Date:   2025-07-14 (Mon, 14 Jul 2025)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
    A llvm/test/CodeGen/Thumb2/LowOverheadLoops/lsr-le-cost.ll
    M llvm/test/CodeGen/Thumb2/LowOverheadLoops/sibling-loops.ll
    M llvm/test/DebugInfo/ARM/hardware-loop-phi-insertion.ll

  Log Message:
  -----------
  [LSR] Account for hardware loop instructions (#147958)

A hardware loop instruction combines a subtract, compare with zero, and
branch. We currently account for the compare and branch being combined
into one in Cost::RateFormula, as part of more general handling for
compare-branch-zero, but don't account for the subtract, leading to
suboptimal decisions in some cases.

Fix this in Cost::RateRegister by noticing when we have such a subtract
and discounting the AddRecCost in such a case.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list