MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::Nest::Node Class Reference

#include <mim/nest.h>

Classes

struct  Children
struct  SiblDeps

Public Types

using SCC = absl::btree_set<const Node*, GIDLt<const Node*>>
 Strongly Connected Component.

Public Member Functions

Getters
std::string name () const
const Nestnest () const
const Node * inest () const
 Immediate nester/parent of this Node.
auto idom () const
 Immediate Dominator for children in connected components.
bool is_root () const
Defmut () const
 The mutable capsulated in this Node or nullptr, if it's a virtual root comprising several Nodes.
uint32_t level () const
uint32_t loop_depth () const
uint32_t gid () const
 Stable id for deterministic hashing/ordering: the underlying mut's gid, or 0 for the (unique) virtual root.
Children
const Childrenchildren () const
Childrenchildren ()
Sibling Dependencies

These are the dependencies across children(): A child n depends() on m, if a subtree of n uses m.

template<bool Forward = true>
auto & sibl_deps ()
template<bool Forward = true>
const auto & sibl_deps () const
SCCs

SCCs for all children dependencies.

Note
The Nest::root() cannot be is_mutually_recursive() by definition. If you have a set of mutually recursive Defs as "root", include them all by using a virtual root.
const auto & SCCs ()
const auto & topo () const
 Topological sorting of all SCCs.
bool is_recursive () const
bool is_mutually_recursive () const
bool is_directly_recursive () const

Friends

class Nest

Detailed Description

Definition at line 32 of file nest.h.

Member Typedef Documentation

◆ SCC

using mim::Nest::Node::SCC = absl::btree_set<const Node*, GIDLt<const Node*>>

Strongly Connected Component.

Definition at line 149 of file nest.h.

Member Function Documentation

◆ children() [1/2]

Children & mim::Nest::Node::children ( )
inline

Definition at line 95 of file nest.h.

◆ children() [2/2]

const Children & mim::Nest::Node::children ( ) const
inline

Definition at line 94 of file nest.h.

Referenced by mim::post_order().

◆ gid()

uint32_t mim::Nest::Node::gid ( ) const
inline

Stable id for deterministic hashing/ordering: the underlying mut's gid, or 0 for the (unique) virtual root.

Definition at line 53 of file nest.h.

◆ idom()

auto mim::Nest::Node::idom ( ) const
inline

Immediate Dominator for children in connected components.

This is used to transform first order programs into structured form in the [sflow](mim::plug::sflow) plugin and for late code placement in [Nest::lca].

Definition at line 42 of file nest.h.

◆ inest()

const Node * mim::Nest::Node::inest ( ) const
inline

Immediate nester/parent of this Node.

Definition at line 38 of file nest.h.

Referenced by mim::Nest::lca().

◆ is_directly_recursive()

bool mim::Nest::Node::is_directly_recursive ( ) const
inline

Definition at line 159 of file nest.h.

References is_recursive().

◆ is_mutually_recursive()

bool mim::Nest::Node::is_mutually_recursive ( ) const
inline

Definition at line 158 of file nest.h.

References is_recursive().

◆ is_recursive()

bool mim::Nest::Node::is_recursive ( ) const
inline

Definition at line 157 of file nest.h.

Referenced by is_directly_recursive(), and is_mutually_recursive().

◆ is_root()

bool mim::Nest::Node::is_root ( ) const
inline

Definition at line 43 of file nest.h.

Referenced by mut().

◆ level()

uint32_t mim::Nest::Node::level ( ) const
inline

Definition at line 49 of file nest.h.

◆ loop_depth()

uint32_t mim::Nest::Node::loop_depth ( ) const
inline

Definition at line 50 of file nest.h.

◆ mut()

Def * mim::Nest::Node::mut ( ) const
inline

The mutable capsulated in this Node or nullptr, if it's a virtual root comprising several Nodes.

Definition at line 45 of file nest.h.

References is_root().

Referenced by mim::Nest::Node::Children::contains(), mim::sexpr::Emitter::finalize(), name(), mim::Nest::Node::Children::operator[](), and mim::post_order().

◆ name()

std::string mim::Nest::Node::name ( ) const
inline

Definition at line 36 of file nest.h.

References mut(), and mim::Def::unique_name().

◆ nest()

const Nest & mim::Nest::Node::nest ( ) const
inline

Definition at line 37 of file nest.h.

References Nest.

Referenced by sibl_deps().

◆ SCCs()

const auto & mim::Nest::Node::SCCs ( )
inline

Definition at line 155 of file nest.h.

◆ sibl_deps() [1/2]

template<bool Forward = true>
auto & mim::Nest::Node::sibl_deps ( )
inline

Definition at line 134 of file nest.h.

References nest().

Referenced by sibl_deps().

◆ sibl_deps() [2/2]

template<bool Forward = true>
const auto & mim::Nest::Node::sibl_deps ( ) const
inline

Definition at line 143 of file nest.h.

References sibl_deps().

◆ topo()

const auto & mim::Nest::Node::topo ( ) const
inline

Topological sorting of all SCCs.

Definition at line 156 of file nest.h.

◆ Nest

friend class Nest
friend

Definition at line 207 of file nest.h.

References Nest.

Referenced by Nest, and nest().


The documentation for this class was generated from the following files: