Skip to content

Commit 3eae7f6

Browse files
committed
Upgrade to ena-0.13.1 and use the new inlined_probe_value function.
This is a big speed win for `keccak` and `inflate`.
1 parent acf7d4d commit 3eae7f6

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -910,9 +910,9 @@ dependencies = [
910910

911911
[[package]]
912912
name = "ena"
913-
version = "0.13.0"
913+
version = "0.13.1"
914914
source = "registry+https://github.com/rust-lang/crates.io-index"
915-
checksum = "3dc01d68e08ca384955a3aeba9217102ca1aa85b6e168639bf27739f1d749d87"
915+
checksum = "8944dc8fa28ce4a38f778bd46bf7d923fe73eed5a439398507246c8e017e6f36"
916916
dependencies = [
917917
"log",
918918
]

src/librustc/infer/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1609,20 +1609,21 @@ impl<'a, 'tcx> ShallowResolver<'a, 'tcx> {
16091609
use self::type_variable::TypeVariableValue;
16101610

16111611
// See the comment in `shallow_resolve()`.
1612-
match self.infcx.type_variables.borrow_mut().probe(v) {
1612+
match self.infcx.type_variables.borrow_mut().inlined_probe(v) {
16131613
TypeVariableValue::Known { value: t } => self.fold_ty(t) != typ,
16141614
TypeVariableValue::Unknown { .. } => false,
16151615
}
16161616
}
16171617

16181618
ty::Infer(ty::IntVar(v)) => {
1619-
match self.infcx.int_unification_table.borrow_mut().probe_value(v) {
1619+
match self.infcx.int_unification_table.borrow_mut().inlined_probe_value(v) {
16201620
Some(v) => v.to_type(self.infcx.tcx) != typ,
16211621
None => false,
16221622
}
16231623
}
16241624

16251625
ty::Infer(ty::FloatVar(v)) => {
1626+
// Not `inlined_probe_value(v)` because this call site is colder.
16261627
match self.infcx.float_unification_table.borrow_mut().probe_value(v) {
16271628
Some(v) => v.to_type(self.infcx.tcx) != typ,
16281629
None => false,

src/librustc/infer/type_variable.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,13 @@ impl<'tcx> TypeVariableTable<'tcx> {
234234
/// Retrieves the type to which `vid` has been instantiated, if
235235
/// any.
236236
pub fn probe(&mut self, vid: ty::TyVid) -> TypeVariableValue<'tcx> {
237-
self.eq_relations.probe_value(vid)
237+
self.inlined_probe(vid)
238+
}
239+
240+
/// An always-inlined variant of `probe`, for very hot call sites.
241+
#[inline(always)]
242+
pub fn inlined_probe(&mut self, vid: ty::TyVid) -> TypeVariableValue<'tcx> {
243+
self.eq_relations.inlined_probe_value(vid)
238244
}
239245

240246
/// If `t` is a type-inference variable, and it has been

src/librustc_data_structures/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ path = "lib.rs"
1010
doctest = false
1111

1212
[dependencies]
13-
ena = "0.13"
13+
ena = "0.13.1"
1414
indexmap = "1"
1515
log = "0.4"
1616
jobserver_crate = { version = "0.1.13", package = "jobserver" }

0 commit comments

Comments
 (0)