diff --git a/src/nouveau/compiler/nak/assign_regs.rs b/src/nouveau/compiler/nak/assign_regs.rs index 6c2f12d9d6b..18fcf45dd66 100644 --- a/src/nouveau/compiler/nak/assign_regs.rs +++ b/src/nouveau/compiler/nak/assign_regs.rs @@ -143,7 +143,7 @@ impl SSAUseMap { pub fn for_block(b: &BasicBlock) -> SSAUseMap { let mut am = SSAUseMap { - ssa_map: HashMap::new(), + ssa_map: Default::default(), }; am.add_block(b); am @@ -207,7 +207,7 @@ impl PhiWebs { PhiWebs { uf, - assignments: HashMap::new(), + assignments: Default::default(), } } @@ -274,7 +274,7 @@ impl RegAllocator { used: BitSet::new(), pinned: BitSet::new(), reg_ssa: Vec::new(), - ssa_reg: HashMap::new(), + ssa_reg: Default::default(), } } @@ -496,7 +496,7 @@ impl<'a> VecRegAllocator<'a> { ra, pcopy: OpParCopy::new(), pinned, - evicted: HashMap::new(), + evicted: Default::default(), } } @@ -933,7 +933,7 @@ impl AssignRegsBlock { }), pcopy_tmp_gprs: pcopy_tmp_gprs, live_in: Vec::new(), - phi_out: HashMap::new(), + phi_out: Default::default(), } } diff --git a/src/nouveau/compiler/nak/calc_instr_deps.rs b/src/nouveau/compiler/nak/calc_instr_deps.rs index 2a1cc631a3c..b27e63af88f 100644 --- a/src/nouveau/compiler/nak/calc_instr_deps.rs +++ b/src/nouveau/compiler/nak/calc_instr_deps.rs @@ -74,8 +74,8 @@ impl DepGraph { pub fn new() -> Self { Self { deps: Vec::new(), - instr_deps: HashMap::new(), - instr_waits: HashMap::new(), + instr_deps: Default::default(), + instr_waits: Default::default(), active: HashSet::new(), } } diff --git a/src/nouveau/compiler/nak/const_tracker.rs b/src/nouveau/compiler/nak/const_tracker.rs index 4be5d11117b..a54ddb8a632 100644 --- a/src/nouveau/compiler/nak/const_tracker.rs +++ b/src/nouveau/compiler/nak/const_tracker.rs @@ -18,7 +18,7 @@ pub struct ConstTracker { impl ConstTracker { pub fn new() -> Self { ConstTracker { - map: HashMap::new(), + map: Default::default(), } } diff --git a/src/nouveau/compiler/nak/from_nir.rs b/src/nouveau/compiler/nak/from_nir.rs index 34c79cb3784..c33f4cbd0b8 100644 --- a/src/nouveau/compiler/nak/from_nir.rs +++ b/src/nouveau/compiler/nak/from_nir.rs @@ -199,7 +199,7 @@ impl<'a> PhiAllocMap<'a> { fn new(alloc: &'a mut PhiAllocator) -> PhiAllocMap<'a> { PhiAllocMap { alloc: alloc, - map: HashMap::new(), + map: Default::default(), } } @@ -345,13 +345,13 @@ impl<'a> ShaderFromNir<'a> { float_ctl: ShaderFloatControls::from_nir(nir), cfg: CFGBuilder::new(), label_alloc: LabelAllocator::new(), - block_label: HashMap::new(), - bar_label: HashMap::new(), + block_label: Default::default(), + bar_label: Default::default(), sync_blocks: HashSet::new(), crs: Vec::new(), fs_out_regs: [None; 34], end_block_id: 0, - ssa_map: HashMap::new(), + ssa_map: Default::default(), saturated: HashSet::new(), nir_instr_printer: NirInstrPrinter::new().unwrap(), } diff --git a/src/nouveau/compiler/nak/legalize.rs b/src/nouveau/compiler/nak/legalize.rs index dfc3a1124da..dc7909e1593 100644 --- a/src/nouveau/compiler/nak/legalize.rs +++ b/src/nouveau/compiler/nak/legalize.rs @@ -439,7 +439,7 @@ fn legalize_instr( sm.legalize_op(b, &mut instr.op); - let mut vec_src_map: HashMap = HashMap::new(); + let mut vec_src_map: HashMap = Default::default(); let mut vec_comps = HashSet::new(); for src in instr.srcs_mut() { if let SrcRef::SSA(vec) = &src.src_ref { diff --git a/src/nouveau/compiler/nak/liveness.rs b/src/nouveau/compiler/nak/liveness.rs index 226504407c2..042502be157 100644 --- a/src/nouveau/compiler/nak/liveness.rs +++ b/src/nouveau/compiler/nak/liveness.rs @@ -240,7 +240,7 @@ impl SimpleBlockLiveness { Self { defs: BitSet::new(), uses: BitSet::new(), - last_use: HashMap::new(), + last_use: Default::default(), live_in: BitSet::new(), live_out: BitSet::new(), } @@ -284,7 +284,7 @@ pub struct SimpleLiveness { impl SimpleLiveness { pub fn for_function(func: &Function) -> SimpleLiveness { let mut l = SimpleLiveness { - ssa_block_ip: HashMap::new(), + ssa_block_ip: Default::default(), blocks: Vec::new(), }; let mut live_in = Vec::new(); @@ -406,7 +406,7 @@ impl NextUseBlockLiveness { fn new(num_instrs: usize) -> Self { Self { num_instrs: num_instrs, - ssa_map: HashMap::new(), + ssa_map: Default::default(), } } diff --git a/src/nouveau/compiler/nak/opt_bar_prop.rs b/src/nouveau/compiler/nak/opt_bar_prop.rs index f7eb45e6e99..c26e5b6208e 100644 --- a/src/nouveau/compiler/nak/opt_bar_prop.rs +++ b/src/nouveau/compiler/nak/opt_bar_prop.rs @@ -15,8 +15,8 @@ struct PhiMap { impl PhiMap { pub fn new() -> PhiMap { PhiMap { - ssa_phi: HashMap::new(), - phi_ssa: HashMap::new(), + ssa_phi: Default::default(), + phi_ssa: Default::default(), } } @@ -57,7 +57,7 @@ struct BarPropPass { impl BarPropPass { pub fn new() -> BarPropPass { BarPropPass { - ssa_map: HashMap::new(), + ssa_map: Default::default(), phi_is_bar: BitSet::new(), phi_is_not_bar: BitSet::new(), } diff --git a/src/nouveau/compiler/nak/opt_copy_prop.rs b/src/nouveau/compiler/nak/opt_copy_prop.rs index fbc5fe7890c..80917192cac 100644 --- a/src/nouveau/compiler/nak/opt_copy_prop.rs +++ b/src/nouveau/compiler/nak/opt_copy_prop.rs @@ -68,7 +68,7 @@ impl<'a> CopyPropPass<'a> { pub fn new(sm: &'a dyn ShaderModel) -> Self { CopyPropPass { sm: sm, - ssa_map: HashMap::new(), + ssa_map: Default::default(), } } diff --git a/src/nouveau/compiler/nak/opt_jump_thread.rs b/src/nouveau/compiler/nak/opt_jump_thread.rs index da4b2ed8187..08ad066677e 100644 --- a/src/nouveau/compiler/nak/opt_jump_thread.rs +++ b/src/nouveau/compiler/nak/opt_jump_thread.rs @@ -31,7 +31,7 @@ fn jump_thread(func: &mut Function) -> bool { let mut progress = false; // A branch to label can be replaced with Op - let mut replacements: HashMap = HashMap::new(); + let mut replacements: HashMap = Default::default(); // Invariant 1: At the end of each loop iteration, // every trivial block with an index in [i, blocks.len()) diff --git a/src/nouveau/compiler/nak/opt_lop.rs b/src/nouveau/compiler/nak/opt_lop.rs index b3d9c686baf..88d6f43853b 100644 --- a/src/nouveau/compiler/nak/opt_lop.rs +++ b/src/nouveau/compiler/nak/opt_lop.rs @@ -49,7 +49,7 @@ impl LopPass { } LopPass { use_counts: use_counts, - ssa_lop: HashMap::new(), + ssa_lop: Default::default(), } } diff --git a/src/nouveau/compiler/nak/opt_prmt.rs b/src/nouveau/compiler/nak/opt_prmt.rs index d20d4093bd9..7e8ad660f30 100644 --- a/src/nouveau/compiler/nak/opt_prmt.rs +++ b/src/nouveau/compiler/nak/opt_prmt.rs @@ -88,7 +88,7 @@ struct PrmtPass { impl PrmtPass { fn new() -> PrmtPass { PrmtPass { - ssa_prmt: HashMap::new(), + ssa_prmt: Default::default(), } } diff --git a/src/nouveau/compiler/nak/opt_uniform_instrs.rs b/src/nouveau/compiler/nak/opt_uniform_instrs.rs index 5c98dab61b4..8eb64d17e46 100644 --- a/src/nouveau/compiler/nak/opt_uniform_instrs.rs +++ b/src/nouveau/compiler/nak/opt_uniform_instrs.rs @@ -48,7 +48,7 @@ fn propagate_r2ur( impl Shader<'_> { pub fn opt_uniform_instrs(&mut self) { let sm = self.sm; - let mut r2ur = HashMap::new(); + let mut r2ur = Default::default(); let mut propagated_r2ur = false; self.map_instrs(|mut instr, alloc| { if matches!( diff --git a/src/nouveau/compiler/nak/repair_ssa.rs b/src/nouveau/compiler/nak/repair_ssa.rs index a95c80798bf..828253f52f5 100644 --- a/src/nouveau/compiler/nak/repair_ssa.rs +++ b/src/nouveau/compiler/nak/repair_ssa.rs @@ -87,7 +87,7 @@ fn get_ssa_or_phi( idx: phi_idx, orig: ssa, dst: phi_ssa, - srcs: HashMap::new(), + srcs: Default::default(), }; for &p_idx in &b.pred { if p_idx >= b_idx { @@ -192,7 +192,7 @@ impl Function { blocks.push(DefTrackerBlock { pred: cfg.pred_indices(b_idx).to_vec(), succ: cfg.succ_indices(b_idx).to_vec(), - defs: RefCell::new(HashMap::new()), + defs: RefCell::new(Default::default()), phis: RefCell::new(Vec::new()), }); diff --git a/src/nouveau/compiler/nak/spill_values.rs b/src/nouveau/compiler/nak/spill_values.rs index c48f51fce3e..137622278e6 100644 --- a/src/nouveau/compiler/nak/spill_values.rs +++ b/src/nouveau/compiler/nak/spill_values.rs @@ -20,7 +20,7 @@ struct PhiDstMap { impl PhiDstMap { fn new() -> PhiDstMap { PhiDstMap { - ssa_phi: HashMap::new(), + ssa_phi: Default::default(), } } @@ -52,7 +52,7 @@ struct PhiSrcMap { impl PhiSrcMap { fn new() -> PhiSrcMap { PhiSrcMap { - phi_src: HashMap::new(), + phi_src: Default::default(), } } @@ -292,7 +292,7 @@ impl<'a, S: Spill> SpillCache<'a, S> { alloc: alloc, spill: spill, const_tracker: ConstTracker::new(), - val_spill: HashMap::new(), + val_spill: Default::default(), } } @@ -592,7 +592,7 @@ fn spill_values( num_preds: usize, next_use: usize, } - let mut live: HashMap = HashMap::new(); + let mut live: HashMap = Default::default(); for p_idx in &preds { let phi_src_map = &phi_src_maps[*p_idx]; diff --git a/src/nouveau/compiler/nak/to_cssa.rs b/src/nouveau/compiler/nak/to_cssa.rs index 0188afe8e50..2d548a5606b 100644 --- a/src/nouveau/compiler/nak/to_cssa.rs +++ b/src/nouveau/compiler/nak/to_cssa.rs @@ -82,8 +82,8 @@ impl<'a> CoalesceGraph<'a> { live: live, nodes: Vec::new(), sets: Vec::new(), - ssa_node: HashMap::new(), - phi_node_file: HashMap::new(), + ssa_node: Default::default(), + phi_node_file: Default::default(), } } diff --git a/src/nouveau/compiler/nak/union_find.rs b/src/nouveau/compiler/nak/union_find.rs index 27c8c9de2e9..fb727ec6669 100644 --- a/src/nouveau/compiler/nak/union_find.rs +++ b/src/nouveau/compiler/nak/union_find.rs @@ -35,7 +35,7 @@ impl UnionFind { /// At initialization, each possible value is in its own set pub fn new() -> Self { UnionFind { - idx_map: HashMap::new(), + idx_map: Default::default(), nodes: Vec::new(), } }