HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Moduleghc-9.14.1GHC2021

GHC.CmmToAsm.Instr

  • 1 type
  • 1 class
  • 1 value
  • Packageghc-9.14.1
  • Exports3
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceInstr.hs
classclass Instruction instr where
#

Common things that we can do with instructions, on all architectures. These are used by the shared parts of the native code generator, specifically the register allocators.

Methods

Instances6Instruction
datadata RegUsage
#

Holds a list of source and destination registers used by a particular instruction.

Machine registers that are pre-allocated to stgRegs are filtered out, because they are uninteresting from a register allocation standpoint. (We wouldn't want them to end up on the free list!)

As far as we are concerned, the fixed registers simply don't exist (for allocation purposes, anyway).

Instances4Show, Outputable
  • Show RegUsageDefined in ghc-9.14.1 · GHC.CmmToAsm.Instr
  • Outputable RegUsageDefined in ghc-9.14.1 · GHC.CmmToAsm.RV64.Instr · orphan
  • Outputable RegUsageDefined in ghc-9.14.1 · GHC.CmmToAsm.LA64.Instr · orphan
  • Outputable RegUsageDefined in ghc-9.14.1 · GHC.CmmToAsm.AArch64.Instr · orphan

    Get the registers that are being used by this instruction. regUsage doesn't need to do any trickery for jumps and such. Just state precisely the regs read and written by that insn. The consequences of control flow transfers, as far as register allocation goes, are taken care of by the register allocator.

    RegUsage = RU [regs] [regs]