diff --git a/src/nouveau/compiler/nak_ir.rs b/src/nouveau/compiler/nak_ir.rs index decd82d2b78..150b9ac529a 100644 --- a/src/nouveau/compiler/nak_ir.rs +++ b/src/nouveau/compiler/nak_ir.rs @@ -1872,10 +1872,14 @@ impl BasicBlock { } } - pub fn map_instrs Vec>(&mut self, map: &F) { + pub fn map_instrs Vec>( + &mut self, + map: &F, + ssa_alloc: &mut SSAValueAllocator, + ) { let mut instrs = Vec::new(); for i in self.instrs.drain(..) { - instrs.append(&mut map(i)); + instrs.append(&mut map(i, ssa_alloc)); } self.instrs = instrs; } @@ -1918,9 +1922,12 @@ impl Function { } } - pub fn map_instrs Vec>(&mut self, map: &F) { + pub fn map_instrs Vec>( + &mut self, + map: &F, + ) { for b in &mut self.blocks { - b.map_instrs(map); + b.map_instrs(map, &mut self.ssa_alloc); } } } @@ -1947,14 +1954,17 @@ impl Shader { } } - pub fn map_instrs Vec>(&mut self, map: &F) { + pub fn map_instrs Vec>( + &mut self, + map: &F, + ) { for f in &mut self.functions { f.map_instrs(map); } } pub fn lower_vec_split(&mut self) { - self.map_instrs(&|instr: Instr| -> Vec { + self.map_instrs(&|instr: Instr, _| -> Vec { match instr.op { Op::FMov(mov) => { vec![Instr::new(Op::FAdd(OpFAdd { diff --git a/src/nouveau/compiler/nak_opt_dce.rs b/src/nouveau/compiler/nak_opt_dce.rs index eb48c3d2300..a000ba3c81e 100644 --- a/src/nouveau/compiler/nak_opt_dce.rs +++ b/src/nouveau/compiler/nak_opt_dce.rs @@ -82,7 +82,7 @@ impl DeadCodePass { } if has_any_dead { - f.map_instrs(&|instr: Instr| -> Vec { + f.map_instrs(&|instr: Instr, _| -> Vec { if self.is_instr_live(&instr) { vec![instr] } else {