Add a TargetIsa::allocatable_registers() method.

This gives the target ISA a chance to reserve registers like the stack
pointer or hard-wired 0 registers like %x0 on RISC-V.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-26 13:54:40 -07:00
parent 305de3e73b
commit bb8ae9a4fb
12 changed files with 85 additions and 19 deletions

View File

@@ -101,8 +101,7 @@ impl Coloring {
encinfo: isa.encoding_info(),
domtree: domtree,
liveness: liveness,
// TODO: Ask the target ISA about reserved registers etc.
usable_regs: AllocatableSet::new(),
usable_regs: isa.allocatable_registers(func),
};
ctx.run(self, func, tracker)
}

View File

@@ -11,4 +11,5 @@ pub mod coloring;
mod affinity;
mod context;
pub use self::allocatable_set::AllocatableSet;
pub use self::context::Context;