[all-commits] [llvm/llvm-project] 5ecbcc: RegScavenger: Add function to externally reserve a...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Wed Feb 2 16:16:05 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5ecbcc207c14a81f3ce006579854307997d26821
      https://github.com/llvm/llvm-project/commit/5ecbcc207c14a81f3ce006579854307997d26821
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

  Changed paths:
    M llvm/include/llvm/CodeGen/RegisterScavenging.h

  Log Message:
  -----------
  RegScavenger: Add function to externally reserve a scavenging index

AMDGPU separately tracks the frame index we use for the emergency
spill slot. In the case where we need to spill SGPRs to memory, we
manually handle the save and restore. In other cases, the scavenger
handles the spills normally.

In a future change, I will need to add a second scavenging index in
order to free a second register in case we are spilling to a large
offset and also have to avoid clobbering a condition register
(SCC). In the intersection of these two cases, we will end up
recursively calling eliminateFrameIndex. We need to report to the
scavenger that the first scavenging frame index is unavailable, and
that the register is already used to avoid double spilling to the
scavenging slot (and avoid clobbering the previously evicted register,
and getting the same register for both scavenge calls).

This is really ugly but I don't see a better way without requiring
targets to be far more aware of how the scavenger iterator is
advanced.




More information about the All-commits mailing list