[all-commits] [llvm/llvm-project] 755662: [CodeGen][MachinePipeliner] Limit register pressur...

Ryotaro KASUGA via All-commits all-commits at lists.llvm.org
Mon Jan 22 00:06:49 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7556626dcff15c8cc5160078a4d6ed2469eed81b
      https://github.com/llvm/llvm-project/commit/7556626dcff15c8cc5160078a4d6ed2469eed81b
  Author: Ryotaro KASUGA <kasuga.ryotaro at fujitsu.com>
  Date:   2024-01-22 (Mon, 22 Jan 2024)

  Changed paths:
    M llvm/include/llvm/CodeGen/MachinePipeliner.h
    M llvm/lib/CodeGen/MachinePipeliner.cpp
    A llvm/test/CodeGen/PowerPC/sms-regpress.mir

  Log Message:
  -----------
  [CodeGen][MachinePipeliner] Limit register pressure when scheduling (#74807)

In software pipelining, when searching for the Initiation Interval (II),
`MachinePipeliner` tries to reduce register pressure, but doesn't check
how many variables can actually be alive at the same time. As a result,
a lot of register spills/fills can be generated after register
allocation, which might cause performance degradation. To prevent such
cases, this patch adds a check phase that calculates the maximum
register pressure of the scheduled loop and reject it if the pressure is
too high. This can be enabled this by specifying
`pipeliner-register-pressure`. Additionally, an II search range is
currently fixed at 10, which is too small to find a schedule when the
above algorithm is applied. Therefore this patch also adds a new option
`pipeliner-ii-search-range` to specify the length of the range to
search. There is one more new option
`pipeliner-register-pressure-margin`, which can be used to estimate a
register pressure limit less than actual for conservative analysis.

Discourse thread:
https://discourse.llvm.org/t/considering-register-pressure-when-deciding-initiation-interval-in-machinepipeliner/74725




More information about the All-commits mailing list