diff --git a/cranelift/codegen/src/alias_analysis.rs b/cranelift/codegen/src/alias_analysis.rs index 6a6e9f2748ba..86e45ec86299 100644 --- a/cranelift/codegen/src/alias_analysis.rs +++ b/cranelift/codegen/src/alias_analysis.rs @@ -70,8 +70,8 @@ use crate::{ ir::{immediates::Offset32, AliasRegion, Block, Function, Inst, Opcode, Type, Value}, trace, }; +use crate::{FxHashMap, FxHashSet}; use cranelift_entity::{packed_option::PackedOption, EntityRef}; -use rustc_hash::{FxHashMap, FxHashSet}; /// For a given program point, the vector of last-store instruction /// indices for each disjoint category of abstract state. diff --git a/cranelift/codegen/src/egraph.rs b/cranelift/codegen/src/egraph.rs index eef19a600717..d727a3d01f57 100644 --- a/cranelift/codegen/src/egraph.rs +++ b/cranelift/codegen/src/egraph.rs @@ -17,11 +17,11 @@ use crate::scoped_hash_map::{Entry as ScopedEntry, ScopedHashMap}; use crate::settings::Flags; use crate::trace; use crate::unionfind::UnionFind; +use crate::FxHashSet; use core::cmp::Ordering; use cranelift_control::ControlPlane; use cranelift_entity::packed_option::ReservedValue; use cranelift_entity::SecondaryMap; -use rustc_hash::FxHashSet; use smallvec::SmallVec; use std::hash::Hasher; diff --git a/cranelift/codegen/src/egraph/elaborate.rs b/cranelift/codegen/src/egraph/elaborate.rs index a35c2ac25734..dc419eaf7f76 100644 --- a/cranelift/codegen/src/egraph/elaborate.rs +++ b/cranelift/codegen/src/egraph/elaborate.rs @@ -10,10 +10,10 @@ use crate::ir::{Block, Function, Inst, Value, ValueDef}; use crate::loop_analysis::{Loop, LoopAnalysis}; use crate::scoped_hash_map::ScopedHashMap; use crate::trace; +use crate::{FxHashMap, FxHashSet}; use alloc::vec::Vec; use cranelift_control::ControlPlane; use cranelift_entity::{packed_option::ReservedValue, SecondaryMap}; -use rustc_hash::{FxHashMap, FxHashSet}; use smallvec::{smallvec, SmallVec}; pub(crate) struct Elaborator<'a> { diff --git a/cranelift/codegen/src/lib.rs b/cranelift/codegen/src/lib.rs index 55f7a12b3437..2e912bb49bbb 100644 --- a/cranelift/codegen/src/lib.rs +++ b/cranelift/codegen/src/lib.rs @@ -21,9 +21,14 @@ extern crate alloc; extern crate std; #[cfg(not(feature = "std"))] -use hashbrown::{hash_map, HashMap}; +use hashbrown::{hash_map, HashMap, HashSet}; #[cfg(feature = "std")] -use std::collections::{hash_map, HashMap}; +use std::collections::{hash_map, HashMap, HashSet}; + +#[allow(missing_docs)] +pub(crate) type FxHashMap = HashMap; +#[allow(missing_docs)] +pub(crate) type FxHashSet = HashSet; pub use crate::context::Context; pub use crate::value_label::{LabelValueLoc, ValueLabelsRanges, ValueLocRange}; diff --git a/cranelift/codegen/src/machinst/abi.rs b/cranelift/codegen/src/machinst/abi.rs index 1849a7e2ffcc..6deefe7335ce 100644 --- a/cranelift/codegen/src/machinst/abi.rs +++ b/cranelift/codegen/src/machinst/abi.rs @@ -104,10 +104,10 @@ use crate::ir::{ArgumentExtension, ArgumentPurpose, Signature}; use crate::isa::TargetIsa; use crate::settings::ProbestackStrategy; use crate::CodegenError; +use crate::FxHashMap; use crate::{ir, isa}; use crate::{machinst::*, trace}; use regalloc2::{MachineEnv, PReg, PRegSet}; -use rustc_hash::FxHashMap; use smallvec::smallvec; use std::collections::HashMap; use std::marker::PhantomData; diff --git a/cranelift/codegen/src/machinst/blockorder.rs b/cranelift/codegen/src/machinst/blockorder.rs index b23fcf4859b1..621483fb294e 100644 --- a/cranelift/codegen/src/machinst/blockorder.rs +++ b/cranelift/codegen/src/machinst/blockorder.rs @@ -65,7 +65,7 @@ use crate::entity::SecondaryMap; use crate::inst_predicates::visit_block_succs; use crate::ir::{Block, Function, Inst, Opcode}; use crate::{machinst::*, trace}; -use rustc_hash::{FxHashMap, FxHashSet}; +use crate::{FxHashMap, FxHashSet}; /// Mapping from CLIF BBs to VCode BBs. #[derive(Debug)] diff --git a/cranelift/codegen/src/machinst/lower.rs b/cranelift/codegen/src/machinst/lower.rs index ea4fda7fc8e8..9a193b49dbd1 100644 --- a/cranelift/codegen/src/machinst/lower.rs +++ b/cranelift/codegen/src/machinst/lower.rs @@ -21,9 +21,9 @@ use crate::machinst::{ }; use crate::settings::Flags; use crate::{trace, CodegenError, CodegenResult}; +use crate::{FxHashMap, FxHashSet}; use alloc::vec::Vec; use cranelift_control::ControlPlane; -use rustc_hash::{FxHashMap, FxHashSet}; use smallvec::{smallvec, SmallVec}; use std::fmt::Debug; diff --git a/cranelift/codegen/src/machinst/vcode.rs b/cranelift/codegen/src/machinst/vcode.rs index 12c816530f04..b7a0555606e3 100644 --- a/cranelift/codegen/src/machinst/vcode.rs +++ b/cranelift/codegen/src/machinst/vcode.rs @@ -24,12 +24,12 @@ use crate::ranges::Ranges; use crate::timing; use crate::trace; use crate::CodegenError; +use crate::FxHashMap; use crate::{LabelValueLoc, ValueLocRange}; use regalloc2::{ Edit, Function as RegallocFunction, InstOrEdit, InstRange, MachineEnv, Operand, OperandConstraint, OperandKind, PRegSet, RegClass, }; -use rustc_hash::FxHashMap; use core::mem::take; use cranelift_entity::{entity_impl, Keys}; diff --git a/cranelift/codegen/src/remove_constant_phis.rs b/cranelift/codegen/src/remove_constant_phis.rs index bb2159c3bbeb..1a5c72fca7df 100644 --- a/cranelift/codegen/src/remove_constant_phis.rs +++ b/cranelift/codegen/src/remove_constant_phis.rs @@ -5,9 +5,9 @@ use crate::ir; use crate::ir::Function; use crate::ir::{Block, BlockCall, Inst, Value}; use crate::timing; +use crate::{FxHashMap, FxHashSet}; use bumpalo::Bump; use cranelift_entity::SecondaryMap; -use rustc_hash::{FxHashMap, FxHashSet}; use smallvec::SmallVec; // A note on notation. For the sake of clarity, this file uses the phrase diff --git a/cranelift/codegen/src/scoped_hash_map.rs b/cranelift/codegen/src/scoped_hash_map.rs index 170a6140d259..53cd22ff4ae7 100644 --- a/cranelift/codegen/src/scoped_hash_map.rs +++ b/cranelift/codegen/src/scoped_hash_map.rs @@ -4,12 +4,12 @@ //! container that has a concept of scopes that can be entered and exited, such that //! values inserted while inside a scope aren't visible outside the scope. +use crate::FxHashMap; use core::hash::Hash; -use rustc_hash::FxHashMap; use smallvec::{smallvec, SmallVec}; #[cfg(not(feature = "std"))] -use crate::fx::FxHasher; +use rustc_hash::FxHasher; #[cfg(not(feature = "std"))] type Hasher = core::hash::BuildHasherDefault;