Inline dominator check.
This commit is contained in:
parent
c2354aabea
commit
f83468c89b
@ -394,6 +394,7 @@ impl<Node: Idx> Dominators<Node> {
|
|||||||
/// # Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// Panics if `b` is unreachable.
|
/// Panics if `b` is unreachable.
|
||||||
|
#[inline]
|
||||||
pub fn dominates(&self, a: Node, b: Node) -> bool {
|
pub fn dominates(&self, a: Node, b: Node) -> bool {
|
||||||
match &self.kind {
|
match &self.kind {
|
||||||
Kind::Path => a.index() <= b.index(),
|
Kind::Path => a.index() <= b.index(),
|
||||||
|
@ -1604,6 +1604,7 @@ impl Location {
|
|||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub fn dominates(&self, other: Location, dominators: &Dominators<BasicBlock>) -> bool {
|
pub fn dominates(&self, other: Location, dominators: &Dominators<BasicBlock>) -> bool {
|
||||||
if self.block == other.block {
|
if self.block == other.block {
|
||||||
self.statement_index <= other.statement_index
|
self.statement_index <= other.statement_index
|
||||||
@ -1623,6 +1624,7 @@ pub enum DefLocation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl DefLocation {
|
impl DefLocation {
|
||||||
|
#[inline]
|
||||||
pub fn dominates(self, location: Location, dominators: &Dominators<BasicBlock>) -> bool {
|
pub fn dominates(self, location: Location, dominators: &Dominators<BasicBlock>) -> bool {
|
||||||
match self {
|
match self {
|
||||||
DefLocation::Argument => true,
|
DefLocation::Argument => true,
|
||||||
|
@ -94,6 +94,7 @@ impl SsaLocals {
|
|||||||
self.direct_uses[local]
|
self.direct_uses[local]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
pub fn assignment_dominates(
|
pub fn assignment_dominates(
|
||||||
&self,
|
&self,
|
||||||
dominators: &Dominators<BasicBlock>,
|
dominators: &Dominators<BasicBlock>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user