Implement pinned register usage through set_pinned_reg/get_pinned_reg;

This commit is contained in:
Benjamin Bouvier
2020-04-21 12:12:03 +02:00
parent d1b5df31fd
commit 241c164e25
7 changed files with 97 additions and 20 deletions

View File

@@ -20,7 +20,7 @@ where
// This lowers the CL IR.
let mut vcode = Lower::new(f, abi).lower(b);
let universe = &B::MInst::reg_universe();
let universe = &B::MInst::reg_universe(vcode.flags());
debug!("vcode from lowering: \n{}", vcode.show_rru(Some(universe)));

View File

@@ -102,6 +102,7 @@ use crate::ir::condcodes::IntCC;
use crate::ir::{Function, Type};
use crate::result::CodegenResult;
use crate::settings::Flags;
use alloc::boxed::Box;
use alloc::vec::Vec;
use core::fmt::Debug;
@@ -189,7 +190,7 @@ pub trait MachInst: Clone + Debug {
fn with_block_offsets(&mut self, my_offset: CodeOffset, targets: &[CodeOffset]);
/// Get the register universe for this backend.
fn reg_universe() -> RealRegUniverse;
fn reg_universe(flags: &Flags) -> RealRegUniverse;
/// Align a basic block offset (from start of function). By default, no
/// alignment occurs.