Color EBB arguments.
When coloring registers for a branch instruction, also make sure that the values passed as EBB arguments are in the registers expected by the EBB. The first time a branch to an EBB is processed, assign the EBB arguments to the registers where the branch arguments already reside so no regmoves are needed.
This commit is contained in:
@@ -104,6 +104,11 @@ impl DataFlowGraph {
|
||||
pub fn ebb_is_valid(&self, ebb: Ebb) -> bool {
|
||||
self.ebbs.is_valid(ebb)
|
||||
}
|
||||
|
||||
/// Get the total number of values.
|
||||
pub fn num_values(&self) -> usize {
|
||||
self.values.len()
|
||||
}
|
||||
}
|
||||
|
||||
/// Resolve value aliases.
|
||||
|
||||
@@ -8,7 +8,7 @@ use ir::StackSlot;
|
||||
use std::fmt;
|
||||
|
||||
/// Value location.
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||
pub enum ValueLoc {
|
||||
/// This value has not been assigned to a location yet.
|
||||
Unassigned,
|
||||
|
||||
Reference in New Issue
Block a user