ghc-9.15: The GHC API
Safe HaskellNone
LanguageGHC2024

GHC.CmmToAsm.Reg.Linear.StackMap

Description

The assignment of virtual registers to stack slots

Synopsis

Documentation

type StackSlot = Int Source #

Identifier for a stack slot.

data StackMap Source #

Constructors

StackMap 

Fields

  • stackMapNextFreeSlot :: !Int

    The slots that are still available to be allocated.

  • stackMapAssignment :: UniqFM Unique (StackSlot, Int)

    Assignment of vregs to stack slots.

    We record not just the slot, but also how many stack slots the vreg takes up, in order to avoid re-using a stack slot for a register that has grown but already had a stack slot (#26668).

emptyStackMap :: StackMap Source #

An empty stack map, with all slots available.

getStackSlotFor :: StackMap -> Format -> Unique -> (StackMap, Int) Source #

If this vreg unique already has a stack assignment then return the slot number, otherwise allocate a new slot, and update the map.

getStackUse :: StackMap -> Int Source #

Return the number of stack slots that were allocated