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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 17 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ thiserror = "1.0.21"
toml = "0.7.2"
url = "2.5.4"
base64 = "^0.22.1"
fxhash = "0.2.1"
rustc-hash = "2.1.1"
build-data = "^0.3.3"
bincode = { version = "^2.0.1", features = ["serde"] }
hex = "0.4.2"
Expand Down
2 changes: 1 addition & 1 deletion acvm-repo/acir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protoc-bin-vendored.workspace = true
serde_json = "1.0"
serde-reflection = "0.3.6"
serde-generate = "0.25.1"
fxhash.workspace = true
rustc-hash.workspace = true
criterion.workspace = true
pprof.workspace = true
num-bigint.workspace = true
Expand Down
5 changes: 3 additions & 2 deletions acvm-repo/acir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ mod reflection {
use std::{
collections::BTreeMap,
fs::File,
hash::BuildHasher,
io::Write,
path::{Path, PathBuf},
};
Expand Down Expand Up @@ -145,7 +146,7 @@ mod reflection {
let old_hash = if path.is_file() {
let old_source = std::fs::read(path).expect("failed to read existing code");
let old_source = String::from_utf8(old_source).expect("old source not UTF-8");
Some(fxhash::hash64(&old_source))
Some(rustc_hash::FxBuildHasher.hash_one(&old_source))
} else {
None
};
Expand All @@ -168,7 +169,7 @@ mod reflection {

if !should_overwrite() {
if let Some(old_hash) = old_hash {
let new_hash = fxhash::hash64(&source);
let new_hash = rustc_hash::FxBuildHasher.hash_one(&source);
assert_eq!(new_hash, old_hash, "Serialization format has changed",);
}
}
Expand Down
2 changes: 1 addition & 1 deletion acvm-repo/acvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ workspace = true
thiserror.workspace = true
tracing.workspace = true
serde.workspace = true
fxhash.workspace = true
rustc-hash.workspace = true
acir.workspace = true
brillig_vm.workspace = true
acvm_blackbox_solver.workspace = true
Expand Down
5 changes: 3 additions & 2 deletions acvm-repo/acvm/src/compiler/transformers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ mod csat;

pub(crate) use csat::CSatTransformer;
pub use csat::MIN_EXPRESSION_WIDTH;
use std::hash::BuildHasher;
use tracing::info;

use super::{
Expand Down Expand Up @@ -65,7 +66,7 @@ pub(super) fn transform_internal<F: AcirField>(
}

// Allow multiple passes until we have stable output.
let mut prev_opcodes_hash = fxhash::hash64(&acir.opcodes);
let mut prev_opcodes_hash = rustc_hash::FxBuildHasher.hash_one(&acir.opcodes);

// For most test programs it would be enough to loop here, but some of them
// don't stabilize unless we also repeat the backend agnostic optimizations.
Expand All @@ -81,7 +82,7 @@ pub(super) fn transform_internal<F: AcirField>(
acir = new_acir;
acir_opcode_positions = new_acir_opcode_positions;

let new_opcodes_hash = fxhash::hash64(&acir.opcodes);
let new_opcodes_hash = rustc_hash::FxBuildHasher.hash_one(&acir.opcodes);

if new_opcodes_hash == prev_opcodes_hash {
break;
Expand Down
2 changes: 1 addition & 1 deletion compiler/noirc_driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ acvm.workspace = true
iter-extended.workspace = true
fm.workspace = true
serde.workspace = true
fxhash.workspace = true
rustc-hash.workspace = true
rust-embed.workspace = true
tracing.workspace = true

Expand Down
4 changes: 3 additions & 1 deletion compiler/noirc_driver/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#![forbid(unsafe_code)]
#![warn(unused_crate_dependencies, unused_extern_crates)]

use std::hash::BuildHasher;

use abi_gen::{abi_type_from_hir_type, value_from_hir_expression};
use acvm::acir::circuit::ExpressionWidth;
use acvm::compiler::MIN_EXPRESSION_WIDTH;
Expand Down Expand Up @@ -798,7 +800,7 @@ pub fn compile_no_check(
|| options.minimal_ssa;

// Hash the AST program, which is going to be used to fingerprint the compilation artifact.
let hash = fxhash::hash64(&program);
let hash = rustc_hash::FxBuildHasher.hash_one(&program);

if let Some(cached_program) = cached_program {
if !force_compile && cached_program.hash == hash {
Expand Down
2 changes: 1 addition & 1 deletion compiler/noirc_errors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ acvm.workspace = true
codespan-reporting.workspace = true
codespan.workspace = true
fm.workspace = true
fxhash.workspace = true
rustc-hash.workspace = true
noirc_printable_type.workspace = true
serde.workspace = true
tracing.workspace = true
Expand Down
7 changes: 4 additions & 3 deletions compiler/noirc_errors/src/call_stack.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use fxhash::FxHashMap;
use rustc_hash::FxHashMap;
use serde::{Deserialize, Serialize};
use std::hash::BuildHasher;

use crate::Location;

Expand Down Expand Up @@ -103,14 +104,14 @@ impl CallStackHelper {

/// Adds a location to the call stack
pub fn add_child(&mut self, call_stack: CallStackId, location: Location) -> CallStackId {
let key = fxhash::hash64(&location);
let key = rustc_hash::FxBuildHasher.hash_one(location);
if let Some(result) = self.locations[call_stack.index()].children_hash.get(&key) {
if self.locations[result.index()].value == location {
return *result;
}
}
let new_location = LocationNode::new(Some(call_stack), location);
let key = fxhash::hash64(&new_location.value);
let key = rustc_hash::FxBuildHasher.hash_one(new_location.value);
self.locations.push(new_location);
let new_location_id = CallStackId::new(self.locations.len() - 1);

Expand Down
3 changes: 2 additions & 1 deletion compiler/noirc_evaluator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ noirc_frontend.workspace = true
noirc_errors.workspace = true
acvm.workspace = true
bn254_blackbox_solver.workspace = true
fxhash.workspace = true
rustc-hash.workspace = true
rustc-stable-hash = "^0.1.2"
iter-extended.workspace = true
thiserror.workspace = true
noirc_printable_type.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion compiler/noirc_evaluator/src/acir/acir_context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ use acvm::{
native_types::{Expression, Witness},
},
};
use fxhash::FxHashMap as HashMap;
use iter_extended::{try_vecmap, vecmap};
use noirc_errors::call_stack::{CallStack, CallStackHelper};
use num_bigint::BigUint;
use num_integer::Integer;
use rustc_hash::FxHashMap as HashMap;
use std::{borrow::Cow, cmp::Ordering};

use crate::ssa::ir::{instruction::Endian, types::NumericType};
Expand Down
2 changes: 1 addition & 1 deletion compiler/noirc_evaluator/src/acir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//! ACIR generation is performed by calling the [Ssa::into_acir] method, providing any necessary brillig bytecode.
//! The compiled program will be returned as an [`Artifacts`] type.

use fxhash::{FxHashMap as HashMap, FxHashSet as HashSet};
use noirc_errors::call_stack::CallStack;
use rustc_hash::{FxHashMap as HashMap, FxHashSet as HashSet};
use std::collections::BTreeMap;
use types::{AcirDynamicArray, AcirValue};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ use crate::ssa::ir::{
};
use acvm::acir::brillig::{MemoryAddress, ValueOrArray};
use acvm::{FieldElement, acir::AcirField};
use fxhash::{FxHashMap as HashMap, FxHashSet as HashSet};
use iter_extended::vecmap;
use noirc_errors::call_stack::{CallStackHelper, CallStackId};
use num_bigint::BigUint;
use rustc_hash::{FxHashMap as HashMap, FxHashSet as HashSet};
use std::collections::BTreeSet;
use std::sync::Arc;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//! - Cached for reuse to avoid redundant register allocation.
//! - Deallocated explicitly when no longer needed (as determined by SSA liveness).
use acvm::FieldElement;
use fxhash::FxHashSet as HashSet;
use rustc_hash::FxHashSet as HashSet;

use crate::{
brillig::brillig_ir::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
value::ValueId,
},
};
use fxhash::FxHashMap as HashMap;
use rustc_hash::FxHashMap as HashMap;

use super::{constant_allocation::ConstantAllocation, variable_liveness::VariableLiveness};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use std::collections::{BTreeMap, BTreeSet};

use acvm::FieldElement;
use fxhash::{FxHashMap as HashMap, FxHashSet as HashSet};
use rustc_hash::{FxHashMap as HashMap, FxHashSet as HashSet};

use super::brillig_block::BrilligBlock;
use super::{BrilligVariable, Function, FunctionContext, ValueId};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ mod tests {
use std::vec;

use acvm::FieldElement;
use fxhash::FxHashMap as HashMap;
use noirc_frontend::monomorphization::ast::InlineType;
use rustc_hash::FxHashMap as HashMap;

use crate::brillig::ValueId;
use crate::brillig::brillig_gen::brillig_block::BrilligBlock;
Expand Down
Loading
Loading