Skip to content

Commit 1766ca0

Browse files
committed
remove Allocation::Fixed
1 parent 5f29c6d commit 1766ca0

2 files changed

Lines changed: 2 additions & 22 deletions

File tree

zjit/src/backend/arm64/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,6 @@ impl Assembler {
16401640
let end = &intervals[i].end();
16411641
let alloc_str = match alloc {
16421642
Allocation::Reg(n) => format!("{}", regs[*n]),
1643-
Allocation::Fixed(reg) => format!("{}", reg),
16441643
Allocation::Stack(n) => format!("Stack[{}]", n),
16451644
};
16461645
println!(" v{} => {} (range: {:?}..{:?})", i, alloc_str, start, end);

zjit/src/backend/lir.rs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,30 +1469,20 @@ impl Interval {
14691469
#[derive(Debug, Clone, Copy, PartialEq)]
14701470
pub enum Allocation {
14711471
Reg(usize),
1472-
Fixed(Reg),
14731472
Stack(usize),
14741473
}
14751474

14761475
impl Allocation {
14771476
fn assigned_reg(self, regs: &[Reg]) -> Option<Reg> {
14781477
match self {
14791478
Allocation::Reg(n) => Some(regs[n]),
1480-
Allocation::Fixed(reg) => Some(reg),
14811479
Allocation::Stack(_) => None,
14821480
}
14831481
}
14841482

14851483
fn alloc_pool_index(self, num_registers: usize) -> Option<usize> {
14861484
match self {
14871485
Allocation::Reg(n) => (n < num_registers).then_some(n),
1488-
Allocation::Fixed(reg) => {
1489-
use crate::backend::current::ALLOC_REGS;
1490-
1491-
ALLOC_REGS
1492-
.iter()
1493-
.take(num_registers)
1494-
.position(|candidate| candidate.reg_no == reg.reg_no)
1495-
}
14961486
Allocation::Stack(_) => None,
14971487
}
14981488
}
@@ -2551,7 +2541,7 @@ impl Assembler
25512541
}
25522542
StackMapEntry::Opnd(Opnd::VReg { idx: vreg, .. }) => {
25532543
let vreg_stack_index = match assignments[vreg].expect("StackMap VReg should have an allocation") {
2554-
Allocation::Reg(_) | Allocation::Fixed(_) => {
2544+
Allocation::Reg(_) => {
25552545
let caller_saved_reg_idx = survivors.iter().position(|&survivor_id| survivor_id == vreg).unwrap();
25562546
let stack_idx = self.stack_state.stack_idx_for_caller_saved_reg(caller_saved_reg_idx);
25572547
self.stack_state.stack_map_index_for_spill(stack_idx, frame_depth)
@@ -2697,7 +2687,7 @@ impl Assembler
26972687
StackMapEntry::Opnd(Opnd::VReg { idx, .. }) => {
26982688
matches!(
26992689
assignments[idx.to_usize()].expect("StackMap VReg should have an allocation"),
2700-
Allocation::Reg(_) | Allocation::Fixed(_)
2690+
Allocation::Reg(_)
27012691
)
27022692
}
27032693
StackMapEntry::Opnd(Opnd::Reg(_)) => true,
@@ -2735,10 +2725,6 @@ impl Assembler
27352725
reg.num_bits = *num_bits;
27362726
*opnd = Opnd::Reg(reg);
27372727
}
2738-
Allocation::Fixed(mut reg) => {
2739-
reg.num_bits = *num_bits;
2740-
*opnd = Opnd::Reg(reg);
2741-
}
27422728
Allocation::Stack(n) => {
27432729
let num_bits = *num_bits;
27442730
*opnd = Opnd::Mem(Mem {
@@ -2759,11 +2745,6 @@ impl Assembler
27592745
mem.base = MemBase::Reg(regs[n].reg_no);
27602746
}
27612747
}
2762-
Allocation::Fixed(reg) => {
2763-
if let Opnd::Mem(mem) = opnd {
2764-
mem.base = MemBase::Reg(reg.reg_no);
2765-
}
2766-
}
27672748
Allocation::Stack(n) => {
27682749
// The VReg used as a memory base was spilled to a stack slot.
27692750
// Mark it as StackIndirect so arm64_scratch_split can load

0 commit comments

Comments
 (0)