Skip to content

Commit a655d4f

Browse files
authored
Revert "Separate vectors for each priority level (#133)" (#134)
This reverts commit 9d38292.
1 parent 9d38292 commit a655d4f

File tree

3 files changed

+153
-183
lines changed

3 files changed

+153
-183
lines changed

src/ion/data_structures.rs

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ pub struct Env<'a, F: Function> {
434434
// was to the approprate PReg.
435435
pub multi_fixed_reg_fixups: Vec<MultiFixedRegFixup>,
436436

437-
pub inserted_moves: [Vec<InsertedMove>; InsertMovePrio::Count as usize],
437+
pub inserted_moves: Vec<InsertedMove>,
438438

439439
// Output:
440440
pub edits: Vec<(PosWithPrio, Edit)>,
@@ -636,41 +636,20 @@ impl LiveRangeSet {
636636

637637
#[derive(Clone, Debug)]
638638
pub struct InsertedMove {
639-
pub pos: ProgPoint,
639+
pub pos_prio: PosWithPrio,
640640
pub from_alloc: Allocation,
641641
pub to_alloc: Allocation,
642642
pub to_vreg: VReg,
643643
}
644644

645-
/// Move priority levels, for resolving move dependency order.
646-
///
647-
/// NOTE: new priority values should be added before `Count`, and `InsertMovePrio::all` should be
648-
/// updated to include the new priority.
649645
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
650-
#[repr(u8)]
651646
pub enum InsertMovePrio {
652647
InEdgeMoves,
653648
Regular,
654649
MultiFixedRegInitial,
655650
MultiFixedRegSecondary,
656651
ReusedInput,
657652
OutEdgeMoves,
658-
659-
/// The number of priorities, used to determine the length of the Env::inserted_moves array.
660-
Count,
661-
}
662-
663-
impl InsertMovePrio {
664-
pub fn all() -> &'static [InsertMovePrio] {
665-
&[
666-
InsertMovePrio::InEdgeMoves,
667-
InsertMovePrio::Regular,
668-
InsertMovePrio::MultiFixedRegInitial,
669-
InsertMovePrio::MultiFixedRegSecondary,
670-
InsertMovePrio::ReusedInput,
671-
InsertMovePrio::OutEdgeMoves,
672-
]
673-
}
674653
}
675654

676655
/// The fields in this struct are reversed in sort order so that the entire

src/ion/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<'a, F: Function> Env<'a, F> {
7474
preferred_victim_by_class: [PReg::invalid(), PReg::invalid(), PReg::invalid()],
7575

7676
multi_fixed_reg_fixups: vec![],
77-
inserted_moves: [vec![], vec![], vec![], vec![], vec![], vec![]],
77+
inserted_moves: vec![],
7878
edits: Vec::with_capacity(n),
7979
allocs: Vec::with_capacity(4 * n),
8080
inst_alloc_offsets: vec![],

0 commit comments

Comments
 (0)