From 7b13bf89627f4c3ba77e852ea3b3855ffeb6706d Mon Sep 17 00:00:00 2001 From: d-sonuga Date: Wed, 7 Aug 2024 20:50:46 +0100 Subject: [PATCH] changed guess of number of operands --- src/fastalloc/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fastalloc/mod.rs b/src/fastalloc/mod.rs index 6286c5f2..25cfaa10 100644 --- a/src/fastalloc/mod.rs +++ b/src/fastalloc/mod.rs @@ -25,8 +25,8 @@ struct Allocs { } impl Allocs { - fn new(func: &F, env: &MachineEnv) -> Self { - let operand_no_guess = func.num_vregs() * 3; + fn new(func: &F) -> Self { + let operand_no_guess = func.num_insts() * 3; let mut allocs = Vec::with_capacity(operand_no_guess); let mut inst_alloc_offsets = Vec::with_capacity(operand_no_guess); for inst in 0..func.num_insts() { @@ -218,7 +218,7 @@ impl<'a, F: Function> Env<'a, F> { env.scratch_by_class[1], env.scratch_by_class[2], ] }, - allocs: Allocs::new(func, env), + allocs: Allocs::new(func), edits: VecDeque::new(), safepoint_slots: Vec::new(), num_spillslots: 0,