Add a minimalistic reload pass.
The reload pass inserts spill and fill instructions as needed so instructions that operate on registers will never see a value with stack affinity. This is a very basic implementation, and we can't write good test cases until we have a spilling pass.
This commit is contained in:
@@ -323,6 +323,16 @@ pub enum ValueDef {
|
||||
Arg(Ebb, usize),
|
||||
}
|
||||
|
||||
impl ValueDef {
|
||||
/// Unwrap the instruction where the value was defined, or panic.
|
||||
pub fn unwrap_inst(&self) -> Inst {
|
||||
match self {
|
||||
&ValueDef::Res(inst, _) => inst,
|
||||
_ => panic!("Value is not an instruction result"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Internal table storage for extended values.
|
||||
#[derive(Clone, Debug)]
|
||||
enum ValueData {
|
||||
|
||||
Reference in New Issue
Block a user