Add fixed_nonallocatable constraints when appropriate (#5253)
Plumb the set of allocatable registers through the OperandCollector and use it validate uses of fixed-nonallocatable registers, like %rsp on x86_64.
This commit is contained in:
@@ -7,24 +7,31 @@ use crate::timing;
|
||||
use crate::trace;
|
||||
|
||||
use regalloc2::RegallocOptions;
|
||||
use regalloc2::{self, MachineEnv};
|
||||
|
||||
/// Compile the given function down to VCode with allocated registers, ready
|
||||
/// for binary emission.
|
||||
pub fn compile<B: LowerBackend + TargetIsa>(
|
||||
f: &Function,
|
||||
flags: crate::settings::Flags,
|
||||
b: &B,
|
||||
abi: Callee<<<B as LowerBackend>::MInst as MachInst>::ABIMachineSpec>,
|
||||
machine_env: &MachineEnv,
|
||||
emit_info: <B::MInst as MachInstEmit>::Info,
|
||||
sigs: SigSet,
|
||||
) -> CodegenResult<(VCode<B::MInst>, regalloc2::Output)> {
|
||||
let machine_env = b.machine_env();
|
||||
|
||||
// Compute lowered block order.
|
||||
let block_order = BlockLoweringOrder::new(f);
|
||||
|
||||
// Build the lowering context.
|
||||
let lower = crate::machinst::Lower::new(f, flags, abi, emit_info, block_order, sigs)?;
|
||||
let lower = crate::machinst::Lower::new(
|
||||
f,
|
||||
b.flags().clone(),
|
||||
machine_env,
|
||||
abi,
|
||||
emit_info,
|
||||
block_order,
|
||||
sigs,
|
||||
)?;
|
||||
|
||||
// Lower the IR.
|
||||
let vcode = {
|
||||
|
||||
Reference in New Issue
Block a user