Add typedefs for the common entity maps.
The various entity maps in a function end up being referenced in multiple places, so create typedefs for them.
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
|
||||
use entity_map::EntityMap;
|
||||
use dominator_tree::DominatorTree;
|
||||
use ir::{Ebb, Inst, Value, Function, Cursor, ValueLoc, DataFlowGraph};
|
||||
use ir::{Ebb, Inst, Value, Function, Cursor, ValueLoc, DataFlowGraph, ValueLocations};
|
||||
use ir::{InstBuilder, Signature, ArgumentType, ArgumentLoc};
|
||||
use isa::{TargetIsa, Encoding, EncInfo, OperandConstraint, ConstraintKind};
|
||||
use isa::{RegUnit, RegClass, RegInfo, regs_overlap};
|
||||
@@ -218,7 +218,7 @@ impl<'a> Context<'a> {
|
||||
fn color_entry_args(&self,
|
||||
sig: &Signature,
|
||||
args: &[LiveValue],
|
||||
locations: &mut EntityMap<Value, ValueLoc>)
|
||||
locations: &mut ValueLocations)
|
||||
-> AllocatableSet {
|
||||
assert_eq!(sig.argument_types.len(), args.len());
|
||||
|
||||
@@ -271,7 +271,7 @@ impl<'a> Context<'a> {
|
||||
fn color_args(&self,
|
||||
args: &[LiveValue],
|
||||
mut regs: AllocatableSet,
|
||||
locations: &mut EntityMap<Value, ValueLoc>)
|
||||
locations: &mut ValueLocations)
|
||||
-> AllocatableSet {
|
||||
// Available registers *after* filtering out the dead arguments.
|
||||
let mut live_regs = regs.clone();
|
||||
@@ -309,7 +309,7 @@ impl<'a> Context<'a> {
|
||||
dfg: &mut DataFlowGraph,
|
||||
tracker: &mut LiveValueTracker,
|
||||
regs: &mut AllocatableSet,
|
||||
locations: &mut EntityMap<Value, ValueLoc>,
|
||||
locations: &mut ValueLocations,
|
||||
func_signature: &Signature) {
|
||||
dbg!("Coloring [{}] {}",
|
||||
self.encinfo.display(encoding),
|
||||
@@ -449,7 +449,7 @@ impl<'a> Context<'a> {
|
||||
// into the constraint solver. Convert them to solver variables so they can be diverted.
|
||||
fn divert_fixed_input_conflicts(&mut self,
|
||||
live: &[LiveValue],
|
||||
locations: &mut EntityMap<Value, ValueLoc>) {
|
||||
locations: &mut ValueLocations) {
|
||||
for lv in live {
|
||||
if let Affinity::Reg(rci) = lv.affinity {
|
||||
let rc = self.reginfo.rc(rci);
|
||||
@@ -468,7 +468,7 @@ impl<'a> Context<'a> {
|
||||
constraints: &[OperandConstraint],
|
||||
defs: &[LiveValue],
|
||||
throughs: &[LiveValue],
|
||||
locations: &mut EntityMap<Value, ValueLoc>) {
|
||||
locations: &mut ValueLocations) {
|
||||
for (op, lv) in constraints.iter().zip(defs) {
|
||||
if let ConstraintKind::FixedReg(reg) = op.kind {
|
||||
self.add_fixed_output(lv.value, op.regclass, reg, throughs, locations);
|
||||
@@ -483,7 +483,7 @@ impl<'a> Context<'a> {
|
||||
abi_types: &[ArgumentType],
|
||||
defs: &[LiveValue],
|
||||
throughs: &[LiveValue],
|
||||
locations: &mut EntityMap<Value, ValueLoc>) {
|
||||
locations: &mut ValueLocations) {
|
||||
// It's technically possible for a call instruction to have fixed results before the
|
||||
// variable list of results, but we have no known instances of that.
|
||||
// Just assume all results are variable return values.
|
||||
@@ -506,7 +506,7 @@ impl<'a> Context<'a> {
|
||||
rc: RegClass,
|
||||
reg: RegUnit,
|
||||
throughs: &[LiveValue],
|
||||
locations: &mut EntityMap<Value, ValueLoc>) {
|
||||
locations: &mut ValueLocations) {
|
||||
if !self.solver.add_fixed_output(rc, reg) {
|
||||
// The fixed output conflicts with some of the live-through registers.
|
||||
for lv in throughs {
|
||||
@@ -538,7 +538,7 @@ impl<'a> Context<'a> {
|
||||
constraints: &[OperandConstraint],
|
||||
defs: &[LiveValue],
|
||||
_dfg: &mut DataFlowGraph,
|
||||
_locations: &mut EntityMap<Value, ValueLoc>) {
|
||||
_locations: &mut ValueLocations) {
|
||||
for (op, lv) in constraints.iter().zip(defs) {
|
||||
match op.kind {
|
||||
ConstraintKind::FixedReg(_) |
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
//! pressure limits to be exceeded.
|
||||
|
||||
use dominator_tree::DominatorTree;
|
||||
use entity_map::EntityMap;
|
||||
use ir::{Ebb, Inst, Value, Function, Signature, DataFlowGraph};
|
||||
use ir::{Ebb, Inst, Value, Function, Signature, DataFlowGraph, InstEncodings};
|
||||
use ir::layout::{Cursor, CursorPosition};
|
||||
use ir::{InstBuilder, Opcode, ArgumentType, ArgumentLoc};
|
||||
use isa::RegClass;
|
||||
@@ -201,7 +200,7 @@ impl<'a> Context<'a> {
|
||||
encoding: Encoding,
|
||||
pos: &mut Cursor,
|
||||
dfg: &mut DataFlowGraph,
|
||||
encodings: &mut EntityMap<Inst, Encoding>,
|
||||
encodings: &mut InstEncodings,
|
||||
func_signature: &Signature,
|
||||
tracker: &mut LiveValueTracker) {
|
||||
// Get the operand constraints for `inst` that we are trying to satisfy.
|
||||
@@ -341,7 +340,7 @@ impl<'a> Context<'a> {
|
||||
stack: Value,
|
||||
reg: Value,
|
||||
pos: &mut Cursor,
|
||||
encodings: &mut EntityMap<Inst, Encoding>,
|
||||
encodings: &mut InstEncodings,
|
||||
dfg: &mut DataFlowGraph) {
|
||||
let ty = dfg.value_type(reg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user