pub fn allocate_registers_with_opts<F: Function>(
    func: &mut F,
    rreg_universe: &RealRegUniverse,
    stackmap_info: Option<&StackmapRequestInfo>,
    opts: Options
) -> Result<RegAllocResult<F>, RegAllocError>
Expand description

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.

The control flow graph must not contain any critical edges, that is, any edge coming from a block with multiple successors must not flow into a block with multiple predecessors. The embedder must have split critical edges before handing over the function to this function. Otherwise, an error will be returned.

Allocation may succeed, returning a RegAllocResult with the new instruction sequence, or it may fail, returning an error.

Runtime options can be passed to the allocators, through the use of Options for options common to all the backends. The choice of algorithm is done by passing a given Algorithm instance, with options tailored for each algorithm.