Skip to content

[MachinePipeliner] Add PipelinerLoopInfo hooks to reuse the reg-pressure detector#3431

Open
hjagasiaAMD wants to merge 1 commit into
amd/dev/hjagasia/swp-01-amdgpu-supportfrom
amd/dev/hjagasia/swp-02-loopinfo-hooks
Open

[MachinePipeliner] Add PipelinerLoopInfo hooks to reuse the reg-pressure detector#3431
hjagasiaAMD wants to merge 1 commit into
amd/dev/hjagasia/swp-01-amdgpu-supportfrom
amd/dev/hjagasia/swp-02-loopinfo-hooks

Conversation

@hjagasiaAMD

Copy link
Copy Markdown

The generic MachinePipeliner register-pressure detector (added in llvm#74807)
was only reachable via the global -pipeliner-register-pressure flag, which
cannot be enabled per-target, and it judges pressure against generic
per-pressure-set limits. Add two PipelinerLoopInfo hooks so a target can
reuse that detector on its own terms:

  • shouldLimitRegPressure(): opt the loop into the detector without the
    global flag. The detector runs inside the II search, so a schedule
    rejected on register pressure is retried at a higher II rather than
    abandoning the loop.
  • isScheduleRegPressureTooHigh(MaxSetPressure): let the target replace the
    detector's generic per-pressure-set limit check with its own verdict, or
    return nullopt to keep that check.

Both hooks default to preserving current behavior, so targets that do not
override them are unaffected: the detector stays gated on
-pipeliner-register-pressure and the generic per-set check is unchanged.

Exercised by the AMDGPU adoption in the following commit.

…ure detector

The generic MachinePipeliner register-pressure detector (added in llvm#74807)
was only reachable via the global -pipeliner-register-pressure flag, which
cannot be enabled per-target, and it judges pressure against generic
per-pressure-set limits. Add two PipelinerLoopInfo hooks so a target can
reuse that detector on its own terms:

- shouldLimitRegPressure(): opt the loop into the detector without the
  global flag. The detector runs inside the II search, so a schedule
  rejected on register pressure is retried at a higher II rather than
  abandoning the loop.
- isScheduleRegPressureTooHigh(MaxSetPressure): let the target replace the
  detector's generic per-pressure-set limit check with its own verdict, or
  return nullopt to keep that check.

Both hooks default to preserving current behavior, so targets that do not
override them are unaffected: the detector stays gated on
-pipeliner-register-pressure and the generic per-set check is unchanged.

Exercised by the AMDGPU adoption in the following commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant