Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/backend/localify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use crate::backend::treeify::Trees;
use crate::cfg::CFGInfo;
use crate::entity::{EntityVec, PerEntity};
use crate::ir::{Block, FunctionBody, Local, Type, Value, ValueDef};
use fxhash::{FxHashMap as HashMap, FxHashSet as HashSet};
use smallvec::{smallvec, SmallVec};
use std::collections::{HashMap, HashSet};
use std::ops::Range;

#[derive(Clone, Debug, Default)]
Expand Down Expand Up @@ -242,13 +242,13 @@ impl<'a> Context<'a> {
ranges.sort_unstable_by_key(|(val, range)| (range.start, *val));

// Keep a list of expiring Locals by expiry point.
let mut expiring: HashMap<usize, SmallVec<[(Type, Local); 8]>> = HashMap::new();
let mut expiring: HashMap<usize, SmallVec<[(Type, Local); 8]>> = HashMap::default();

// Iterate over allocation space, processing range starts (at
// which point we allocate) and ends (at which point we add to
// the freelist).
let mut range_idx = 0;
let mut freelist: HashMap<Type, Vec<Local>> = HashMap::new();
let mut freelist: HashMap<Type, Vec<Local>> = HashMap::default();

for i in 0..self.points {
// Process ends. (Ends are exclusive, so we do them
Expand Down
3 changes: 2 additions & 1 deletion src/backend/reducify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,11 @@

use crate::entity::EntityRef;
use crate::{cfg::CFGInfo, cfg::RPOIndex, entity::PerEntity, Block, FunctionBody, Value, ValueDef};
use fxhash::FxHashSet as HashSet;
use fxhash::{FxHashMap, FxHashSet};
use smallvec::SmallVec;
use std::borrow::Cow;
use std::collections::{HashSet, VecDeque};
use std::collections::VecDeque;

pub struct Reducifier<'a> {
body: &'a FunctionBody,
Expand Down
8 changes: 4 additions & 4 deletions src/backend/stackify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use crate::cfg::CFGInfo;
use crate::entity::EntityRef;
use crate::ir::{Block, BlockTarget, FunctionBody, Terminator, Type, Value};
use std::collections::HashSet;
use fxhash::FxHashSet as HashSet;
use std::convert::TryFrom;

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -134,9 +134,9 @@ impl<'a, 'b> Context<'a, 'b> {
body: &FunctionBody,
cfg: &CFGInfo,
) -> anyhow::Result<(HashSet<Block>, HashSet<Block>)> {
let mut loop_headers = HashSet::new();
let mut branched_once = HashSet::new();
let mut merge_nodes = HashSet::new();
let mut loop_headers = HashSet::default();
let mut branched_once = HashSet::default();
let mut merge_nodes = HashSet::default();

for (block_rpo, &block) in cfg.rpo.entries() {
for &succ in &body.blocks[block].succs {
Expand Down
4 changes: 2 additions & 2 deletions src/interp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::ir::*;
use crate::ops::Operator;
use smallvec::{smallvec, SmallVec};

use std::collections::HashMap;
use fxhash::FxHashMap as HashMap;

/// How large do we allow a Wasm memory to be when interpreting? Limit
/// the size somewhat (apply an implementation limit) so we do not
Expand Down Expand Up @@ -156,7 +156,7 @@ impl InterpContext {
let mut frame = InterpStackFrame {
func,
cur_block: body.entry,
values: HashMap::new(),
values: HashMap::default(),
};

for (&arg, &(_, blockparam)) in args.iter().zip(body.blocks[body.entry].params.iter()) {
Expand Down
2 changes: 1 addition & 1 deletion src/ir/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use crate::declare_entity;
use crate::entity::EntityVec;
#[cfg(feature = "dwarf")]
use addr2line::gimli;
use fxhash::FxHashMap as HashMap;
use std::collections::hash_map::Entry as HashEntry;
use std::collections::HashMap;

declare_entity!(SourceFile, "file");
declare_entity!(SourceLoc, "loc");
Expand Down
4 changes: 2 additions & 2 deletions src/ir/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use super::{Func, FuncDecl, FunctionBody, Module, SourceLoc, ValueDef};
use crate::entity::EntityRef;
use std::collections::HashMap;
use fxhash::FxHashMap as HashMap;
use std::fmt::{self, Display, Formatter, Result as FmtResult};

/// Hooks to print information after instruction, before and after blocks
Expand Down Expand Up @@ -253,7 +253,7 @@ impl<'a, PD: PrintDecorator> Display for ModuleDisplay<'a, PD> {
if let Some(func) = self.module.start_func {
writeln!(f, " start = {}", func)?;
}
let mut sig_strs = HashMap::new();
let mut sig_strs = HashMap::default();
for (sig, sig_data) in self.module.signatures.entries() {
let arg_tys = sig_data
.params
Expand Down
2 changes: 1 addition & 1 deletion src/ir/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::pool::{ListPool, ListRef};
use crate::Operator;
use anyhow::Result;
use fxhash::FxHashMap;
use std::collections::HashSet;
use fxhash::FxHashSet as HashSet;

/// A declaration of a function: there is one `FuncDecl` per `Func`
/// index.
Expand Down
5 changes: 3 additions & 2 deletions src/passes/maxssa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
use crate::cfg::CFGInfo;
use crate::entity::PerEntity;
use crate::ir::{Block, FunctionBody, Value, ValueDef};
use std::collections::{BTreeSet, HashMap, HashSet};
use fxhash::{FxHashMap as HashMap, FxHashSet as HashSet};
use std::collections::BTreeSet;

pub(crate) fn run(body: &mut FunctionBody, cut_blocks: Option<HashSet<Block>>, cfg: &CFGInfo) {
MaxSSAPass::new(cut_blocks).run(body, cfg);
Expand All @@ -30,7 +31,7 @@ impl MaxSSAPass {
Self {
cut_blocks,
new_args: PerEntity::default(),
value_map: HashMap::new(),
value_map: HashMap::default(),
}
}

Expand Down
Loading