From f83468c89b706e686ff2d991299789050ea493de Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Wed, 3 May 2023 18:39:21 +0000 Subject: [PATCH] Inline dominator check. --- compiler/rustc_data_structures/src/graph/dominators/mod.rs | 1 + compiler/rustc_middle/src/mir/mod.rs | 2 ++ compiler/rustc_mir_transform/src/ssa.rs | 1 + 3 files changed, 4 insertions(+) diff --git a/compiler/rustc_data_structures/src/graph/dominators/mod.rs b/compiler/rustc_data_structures/src/graph/dominators/mod.rs index 4b819e1cbd6..a45f1dd72a1 100644 --- a/compiler/rustc_data_structures/src/graph/dominators/mod.rs +++ b/compiler/rustc_data_structures/src/graph/dominators/mod.rs @@ -394,6 +394,7 @@ impl Dominators { /// # Panics /// /// Panics if `b` is unreachable. + #[inline] pub fn dominates(&self, a: Node, b: Node) -> bool { match &self.kind { Kind::Path => a.index() <= b.index(), diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index 5c425fef27e..0a35afddf40 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -1604,6 +1604,7 @@ impl Location { false } + #[inline] pub fn dominates(&self, other: Location, dominators: &Dominators) -> bool { if self.block == other.block { self.statement_index <= other.statement_index @@ -1623,6 +1624,7 @@ pub enum DefLocation { } impl DefLocation { + #[inline] pub fn dominates(self, location: Location, dominators: &Dominators) -> bool { match self { DefLocation::Argument => true, diff --git a/compiler/rustc_mir_transform/src/ssa.rs b/compiler/rustc_mir_transform/src/ssa.rs index 3a6e1ef3488..1ed3b14e755 100644 --- a/compiler/rustc_mir_transform/src/ssa.rs +++ b/compiler/rustc_mir_transform/src/ssa.rs @@ -94,6 +94,7 @@ impl SsaLocals { self.direct_uses[local] } + #[inline] pub fn assignment_dominates( &self, dominators: &Dominators,