Expand description
Main file / top-level module for regalloc library.
We have tried hard to make the library’s interface as simple as possible, yet flexible enough that the allocators it implements can provide good quality allocations in reasonable time. Nevertheless, there is still significant semantic complexity in parts of the interface. If you intend to use this library in your own code, you would be well advised to read the comments in this file very carefully.
Structs§
- Backtracking
Options - Checker
Errors - A set of errors detected by the regalloc checker.
- IRSnapshot
- Linear
Scan Options - Options
- Tweakable options shared by all the allocators.
- Range
- RealReg
- Real
RegUniverse - Reg
- RegAlloc
Result - The result of register allocation. Note that allocation can fail!
- RegClass
Info - Information about a single register class in the
RealRegUniverse
. - RegUsage
Collector - Set
- Spill
Slot - Stackmap
Request Info - A structure with which callers can request stackmap information.
- Typed
IxVec - Virtual
Reg - Writable
- A “writable register”. This is a zero-cost wrapper that can be used to create a distinction, at the Rust type level, between a plain “register” and a “writable register”.
Enums§
- Algorithm
- Algorithm
With Defaults - A choice of register allocation algorithm to run.
- Analysis
Error - BlockIx
- Checker
Error - A single error detected by the regalloc checker.
- InstIx
- RegAlloc
Error - An error from the register allocator.
- RegClass
Constants§
- NUM_
REG_ CLASSES - The number of register classes that exist. N.B.: must be <= 7 (fit into 3 bits) for 32-bit VReg/RReg packed format!
Traits§
- Function
- A trait defined by the regalloc client to provide access to its machine-instruction / CFG representation.
- Pretty
Print - A trait for printing instruction bits and pieces, with the the ability to take a
contextualising
RealRegUniverse
that is used to give proper names to registers. - Pretty
Print Sized - Same as
PrettyPrint
, but can also take a size hint into account to specialize the displayed string. - RegUsage
Mapper - A trait for providing mapping results for a given instruction.
- Writable
Base - Set of requirements for types that can be wrapped in Writable.
Functions§
- allocate_
registers - Allocate registers for a function’s code, given a universe of real registers that we are allowed to use.
- allocate_
registers_ with_ opts - Allocate registers for a function’s code, given a universe of real registers that we are allowed to use. Optionally, stackmap support may be requested.