Moduleghc-9.10.3GHC2021
GHC.CmmToAsm.Reg.Liveness
- 9 types
- 19 values
- Packageghc-9.10.3
- Exports28
- LanguageGHC2021
- LicenceBSD-3-Clause
- SourceLiveness.hs
Map from some kind of register to a.
While we give the type for keys as Reg which is the common case sometimes we end up using VirtualReq or naked Uniques. See Note [UniqFM and the register allocator]
A top level thing which carries liveness information.
The register allocator also wants to use SPILL/RELOAD meta instructions, so we'll keep those here.
Instances3Functor, Outputable, Instruction
Functor InstrSRDefined in ghc-9.10.3 · GHC.CmmToAsm.Reg.LivenessOutputable instr => Outputable (InstrSR instr)Defined in ghc-9.10.3 · GHC.CmmToAsm.Reg.LivenessInstruction instr => Instruction (InstrSR instr)Defined in ghc-9.10.3 · GHC.CmmToAsm.Reg.Liveness
Instances3Functor, OutputableP, Outputable
Functor LiveInstrDefined in ghc-9.10.3 · GHC.CmmToAsm.Reg.LivenessOutputableP env instr => OutputableP env (LiveInstr instr)Defined in ghc-9.10.3 · GHC.CmmToAsm.Reg.LivenessOutputable instr => Outputable (LiveInstr instr)Defined in ghc-9.10.3 · GHC.CmmToAsm.Reg.Liveness
Liveness information. The regs which die are ones which are no longer live in the *next* instruction in this sequence. (NB. if the instruction is a jump, these registers might still be live at the jump target(s) - you have to check the liveness at the destination block to find out).
Constructors
LivenessliveBorn :: RegSetregisters born in this instruction (written to for first time).
liveDieRead :: RegSetregisters that died because they were read for the last time.
liveDieWrite :: RegSetregisters that died because they were clobbered by something.
Stash regs live on entry to each basic block in the info part of the cmm code.
Instances1OutputableP
OutputableP Platform LiveInfoDefined in ghc-9.10.3 · GHC.CmmToAsm.Reg.Liveness
A basic block with liveness information.
map a function across all the basic blocks in this code
map a function across all the basic blocks in this code (monadic version)
map a function across all the basic blocks in this code (monadic version)
Map over instruction type in LiveCmmDecl
Pretty-print a LiveCmmDecl
Strip away liveness information, yielding NatCmmDecl
Strip away liveness information from a basic block, and make real spill instructions out of SPILL, RELOAD pseudos along the way.
Slurp out the list of register conflicts and reg-reg moves from this top level thing. Slurping of conflicts and moves is wrapped up together so we don't have to make two passes over the same code when we want to build the graph.
For spill/reloads
SPILL v1, slot1 ... RELOAD slot1, v2
If we can arrange that v1 and v2 are allocated to the same hreg it's more likely the spill/reload instrs can be cleaned and replaced by a nop reg-reg move.
Erase Delta instructions.
Patch the registers in this code according to this register mapping. also erase reg -> reg moves when the reg is the same. also erase reg -> reg moves when the destination dies in this instr.
Patch registers in this LiveInstr, including the liveness information.
If we've compute liveness info for this code already we have to reverse the SCCs in each top to get them back to the right order so we can do it again.
Convert a NatCmmDecl to a LiveCmmDecl, with liveness information