Implement value affinities for register allocation.

An SSA value is usually biased towards a specific register class or a
stack slot, depending on the constraints of the instructions using it.

Represent this bias as an Affinity enum, and implement a merging
algorithm for updating an affinity to satisfy a new constraint.

Affinities will be computed as part of the liveness analysis. This is
not implemented yet.
This commit is contained in:
Jakob Stoklund Olesen
2017-01-26 14:51:49 -08:00
parent fd3cd153ed
commit 16f4b4c7d5
7 changed files with 90 additions and 7 deletions

View File

@@ -41,8 +41,8 @@
//! concurrent function compilations.
pub use isa::encoding::Encoding;
pub use isa::registers::{RegInfo, RegUnit, RegClass};
pub use isa::constraints::RecipeConstraints;
pub use isa::registers::{RegInfo, RegUnit, RegClass, RegClassIndex};
pub use isa::constraints::{RecipeConstraints, OperandConstraint, ConstraintKind};
use settings;
use ir::{InstructionData, DataFlowGraph};