Jlm
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
jlm::rvsdg Namespace Reference

Namespaces

 base
 
 detail
 

Classes

class  BinaryOperation
 
class  FlattenedBinaryOperation
 
struct  reduce_neg
 
struct  reduce_not
 
struct  reduce_add
 
struct  reduce_and
 
struct  reduce_ashr
 
struct  reduce_mul
 
struct  reduce_or
 
struct  reduce_sdiv
 
struct  reduce_shl
 
struct  reduce_shr
 
struct  reduce_smod
 
struct  reduce_smulh
 
struct  reduce_sub
 
struct  reduce_udiv
 
struct  reduce_umod
 
struct  reduce_umulh
 
struct  reduce_xor
 
class  MakeBitUnaryOperation
 
class  MakeBitBinaryOperation
 
class  BitUnaryOperation
 
class  BitBinaryOperation
 
class  BitCompareOperation
 
struct  reduce_eq
 
struct  reduce_ne
 
struct  reduce_sge
 
struct  reduce_sgt
 
struct  reduce_sle
 
struct  reduce_slt
 
struct  reduce_uge
 
struct  reduce_ugt
 
struct  reduce_ule
 
struct  reduce_ult
 
class  MakeBitComparisonOperation
 
class  BitConcatOperation
 
class  BitConstantOperation
 
class  BitSliceOperation
 
class  BitType
 
class  BitValueRepresentation
 
class  ControlType
 
class  ControlValueRepresentation
 
class  ControlConstantOperation
 
class  MatchOperation
 
class  DeltaOperation
 Delta operation. More...
 
class  DeltaNode
 Delta node. More...
 
class  DotWriter
 
class  FunctionType
 Function type class. More...
 
class  GammaOperation
 
class  GammaNode
 Conditional operator / pattern matching. More...
 
class  GraphImport
 
class  GraphExport
 
class  Graph
 
class  LambdaOperation
 Lambda operation. More...
 
class  LambdaNode
 Lambda node. More...
 
class  LambdaBuilder
 Constructs a lambda node. More...
 
struct  member_function_pointer_argtype
 Template helper to deduce argument type of member function pointer. More...
 
struct  member_function_pointer_argtype< Ret(MFP::*)(Args...)>
 
struct  member_function_pointer_argtype< Ret(MFP::*)(Args...) const >
 
struct  member_function_pointer_restype
 Template helper to deduce result type of member function pointer. More...
 
struct  member_function_pointer_restype< Ret(MFP::*)(Args...)>
 
struct  member_function_pointer_restype< Ret(MFP::*)(Args...) const >
 
struct  CallableArgumentType
 Template helper to deduce first argument of a callable object. More...
 
struct  CallableArgumentType< Ret(Args...)>
 
struct  CallableResultType
 Template helper to deduce result of a callable object. More...
 
struct  CallableResultType< Ret(Args...)>
 
class  Input
 
class  Output
 
class  NodeInput
 
class  NodeOutput
 
class  Node
 
class  NullaryOperation
 Nullary operator (operator taking no formal arguments) More...
 
class  Operation
 
class  SimpleOperation
 
class  StructuralOperation
 
class  PhiOperation
 
class  PhiNode
 A phi node represents the fixpoint of mutually recursive definitions. More...
 
class  PhiBuilder
 
class  RegionArgument
 Represents the argument of a region. More...
 
class  RegionResult
 Represents the result of a region. More...
 
class  Region
 Represent acyclic RVSDG subgraphs. More...
 
class  RegionObserver
 Proxy object to observe changes to a region. More...
 
class  RecordingObserver
 
class  RvsdgModule
 
class  SimpleNode
 
class  StructuralNode
 
class  StructuralInput
 
class  StructuralOutput
 
class  SubstitutionMap
 
class  TestStructuralOperation
 
class  TestStructuralNode
 
class  TestNullaryOperation
 
class  TestUnaryOperation
 
class  TestBinaryOperation
 
class  TestOperation
 
class  TestType
 
class  ThetaOperation
 
class  ThetaNode
 
class  OutputTracer
 
class  Transformation
 Represents an RVSDG transformation. More...
 
class  TransformationSequence
 
class  Type
 
class  UnaryOperation
 Unary operator. More...
 
class  UnitType
 Unit type (type carrying no information) More...
 

Typedefs

typedef size_t binop_reduction_path_t
 
using bitneg_op = MakeBitUnaryOperation< reduce_neg, BitNegateLabel >
 
using bitnot_op = MakeBitUnaryOperation< reduce_not, BitNotLabel >
 
using bitadd_op = MakeBitBinaryOperation< reduce_add, BitAddLabel, BinaryOperation::flags::associative|BinaryOperation::flags::commutative >
 
using bitand_op = MakeBitBinaryOperation< reduce_and, BitAndLabel, BinaryOperation::flags::associative|BinaryOperation::flags::commutative >
 
using bitashr_op = MakeBitBinaryOperation< reduce_ashr, BitAShrLabel, BinaryOperation::flags::none >
 
using bitmul_op = MakeBitBinaryOperation< reduce_mul, BitMulLabel, BinaryOperation::flags::associative|BinaryOperation::flags::commutative >
 
using bitor_op = MakeBitBinaryOperation< reduce_or, BitOrLabel, BinaryOperation::flags::associative|BinaryOperation::flags::commutative >
 
using bitsdiv_op = MakeBitBinaryOperation< reduce_sdiv, BitSDivLabel, BinaryOperation::flags::none >
 
using bitshl_op = MakeBitBinaryOperation< reduce_shl, BitShlLabel, BinaryOperation::flags::none >
 
using bitshr_op = MakeBitBinaryOperation< reduce_shr, BitShrLabel, BinaryOperation::flags::none >
 
using bitsmod_op = MakeBitBinaryOperation< reduce_smod, BitSModLabel, BinaryOperation::flags::none >
 
using bitsmulh_op = MakeBitBinaryOperation< reduce_smulh, BitSMulHLabel, BinaryOperation::flags::commutative >
 
using bitsub_op = MakeBitBinaryOperation< reduce_sub, BitSubLabel, BinaryOperation::flags::none >
 
using bitudiv_op = MakeBitBinaryOperation< reduce_udiv, BitUDivLabel, BinaryOperation::flags::none >
 
using bitumod_op = MakeBitBinaryOperation< reduce_umod, BitUModLabel, BinaryOperation::flags::none >
 
using bitumulh_op = MakeBitBinaryOperation< reduce_umulh, BitUMulHLabel, BinaryOperation::flags::commutative >
 
using bitxor_op = MakeBitBinaryOperation< reduce_xor, BitXorLabel, BinaryOperation::flags::associative|BinaryOperation::flags::commutative >
 
using biteq_op = MakeBitComparisonOperation< reduce_eq, BitEqLabel, BinaryOperation::flags::commutative >
 
using bitne_op = MakeBitComparisonOperation< reduce_ne, BitNeLabel, BinaryOperation::flags::commutative >
 
using bitsge_op = MakeBitComparisonOperation< reduce_sge, BitSgeLabel, BinaryOperation::flags::none >
 
using bitsgt_op = MakeBitComparisonOperation< reduce_sgt, BitSgtLabel, BinaryOperation::flags::none >
 
using bitsle_op = MakeBitComparisonOperation< reduce_sle, BitSleLabel, BinaryOperation::flags::none >
 
using bitslt_op = MakeBitComparisonOperation< reduce_slt, BitSltLabel, BinaryOperation::flags::none >
 
using bituge_op = MakeBitComparisonOperation< reduce_uge, BitUgeLabel, BinaryOperation::flags::none >
 
using bitugt_op = MakeBitComparisonOperation< reduce_ugt, BitUgtLabel, BinaryOperation::flags::none >
 
using bitule_op = MakeBitComparisonOperation< reduce_ule, BitUleLabel, BinaryOperation::flags::none >
 
using bitult_op = MakeBitComparisonOperation< reduce_ult, BitUltLabel, BinaryOperation::flags::none >
 
template<class TOperation >
using NodeNormalization = std::function< std::optional< std::vector< Output * > >(const TOperation &, const std::vector< Output * > &)>
 
typedef jlm::util::IntrusiveList< RegionArgument, RegionArgument::structural_input_accessorargument_list
 
typedef jlm::util::IntrusiveList< RegionResult, RegionResult::structural_output_accessorresult_list
 
using TopDownTraverser = detail::TopDownTraverserGeneric< false >
 Traverser for visiting every node in a region in a top down order. More...
 
using TopDownConstTraverser = detail::TopDownTraverserGeneric< true >
 Traverser for visiting every node in a const region in a top down order. More...
 
using BottomUpTraverser = detail::BottomUpTraverserGeneric< false >
 Traverser for visiting every node in a region in a bottom up order. More...
 
using BottomUpConstTraverser = detail::BottomUpTraverserGeneric< true >
 Traverser for visiting every node in a const region in a bottom up order. More...
 
typedef size_t unop_reduction_path_t
 

Enumerations

enum class  compare_result { undecidable , static_true , static_false }
 
enum class  TypeKind { Value , State }
 The kinds of types supported in rvsdg. More...
 

Functions

std::optional< std::vector< rvsdg::Output * > > FlattenAssociativeBinaryOperation (const BinaryOperation &operation, const std::vector< rvsdg::Output * > &operands)
 Flattens a cascade of the same binary operations into a single flattened binary operation. More...
 
std::optional< std::vector< rvsdg::Output * > > NormalizeBinaryOperation (const BinaryOperation &operation, const std::vector< rvsdg::Output * > &operands)
 Applies the reductions implemented in the binary operations reduction functions. More...
 
static jlm::rvsdg::Outputreduce_parallel (const BinaryOperation &op, const std::vector< jlm::rvsdg::Output * > &operands)
 
static jlm::rvsdg::Outputreduce_linear (const BinaryOperation &op, const std::vector< jlm::rvsdg::Output * > &operands)
 
std::optional< std::vector< rvsdg::Output * > > NormalizeFlattenedBinaryOperation (const FlattenedBinaryOperation &operation, const std::vector< rvsdg::Output * > &operands)
 Applies the reductions of the binary operation represented by the flattened binary operation. More...
 
static constexpr enum BinaryOperation::flags operator| (enum BinaryOperation::flags a, enum BinaryOperation::flags b)
 
static constexpr enum BinaryOperation::flags operator& (enum BinaryOperation::flags a, enum BinaryOperation::flags b)
 
jlm::rvsdg::Outputbitconcat (const std::vector< jlm::rvsdg::Output * > &operands)
 
static std::vector< std::shared_ptr< const BitType > > GetTypesFromOperands (const std::vector< rvsdg::Output * > &args)
 
std::optional< std::vector< rvsdg::Output * > > FlattenBitConcatOperation (const BitConcatOperation &, const std::vector< rvsdg::Output * > &operands)
 
jlm::rvsdg::Outputbitslice (jlm::rvsdg::Output *operand, size_t low, size_t high)
 Create bitslice. More...
 
jlm::rvsdg::Outputmatch (size_t nbits, const std::unordered_map< uint64_t, uint64_t > &mapping, uint64_t default_alternative, size_t nalternatives, jlm::rvsdg::Output *operand)
 
static bool is_predicate_reducible (const GammaNode *gamma)
 
static void perform_predicate_reduction (GammaNode *gamma)
 
static bool perform_invariant_reduction (GammaNode *gamma)
 
static std::unordered_set< jlm::rvsdg::Output * > is_control_constant_reducible (GammaNode *gamma)
 
static void perform_control_constant_reduction (std::unordered_set< jlm::rvsdg::Output * > &outputs)
 
bool ReduceGammaWithStaticallyKnownPredicate (Node &node)
 
bool ReduceGammaControlConstant (Node &node)
 
bool ReduceGammaInvariantVariables (Node &node)
 
std::optional< rvsdg::Output * > GetGammaInvariantOrigin (const GammaNode &gamma, const GammaNode::ExitVar &exitvar)
 Determines whether a gamma exit var is path-invariant. More...
 
rvsdg::LambdaNodegetSurroundingLambdaNode (rvsdg::Node &node)
 
const rvsdg::LambdaNodegetSurroundingLambdaNode (const rvsdg::Node &node)
 
template<typename T , typename... Fns>
void MatchType (T &obj, const Fns &... fns)
 Pattern match over subclass type of given object. More...
 
template<typename T >
void MatchType (T &x)
 
template<typename T , typename Fn , typename... Fns>
void MatchType (T &x, const Fn &fn, const Fns &... fns)
 
template<typename T , typename... Fns>
void MatchTypeWithDefault (T &obj, const Fns &... fns)
 Pattern match over subclass type of given object with default handler. More...
 
template<typename T , typename Fn >
CallableResultType< Fn >::type MatchTypeWithDefault (T &, const Fn &fn)
 
template<typename T , typename Fn , typename... Fns>
CallableResultType< Fn >::type MatchTypeWithDefault (T &x, const Fn &fn, const Fns &... fns)
 
template<typename T , typename... Fns>
void MatchTypeOrFail (T &obj, const Fns &... fns)
 Pattern match over subclass type of given object. More...
 
template<typename T , typename Fn >
CallableResultType< Fn >::type MatchTypeOrFail (T &x, const Fn &fn)
 
template<typename T , typename Fn , typename... Fns>
CallableResultType< Fn >::type MatchTypeOrFail (T &x, const Fn &fn, const Fns &... fns)
 
static InputComputeNextInput (const Input *input)
 
static OutputComputeNextOutput (const Output *output)
 
OutputRouteToRegion (Output &output, Region &region)
 
template<class T >
static bool is (const jlm::rvsdg::Input &input) noexcept
 
template<class T >
static bool is (const jlm::rvsdg::Output *output) noexcept
 
template<class OperationType >
bool is (const Node *node) noexcept
 Checks if the given node is not null, and has an operation of the specified type. More...
 
template<typename TOperation >
const TOperation * tryGetOperation (const Node &node) noexcept
 
template<typename NodeType >
NodeType * TryGetOwnerNode (const rvsdg::Input &input) noexcept
 Checks if this is an input to a node of specified type. More...
 
template<typename NodeType >
NodeType * TryGetOwnerNode (const rvsdg::Output &output) noexcept
 Checks if this is an output to a node of specified type. More...
 
template<typename NodeType >
NodeType & AssertGetOwnerNode (const rvsdg::Input &input)
 Asserts that this is an input to a node of specified type. More...
 
template<typename NodeType >
NodeType & AssertGetOwnerNode (const rvsdg::Output &output)
 Asserts that this is an output of a node of specified type. More...
 
template<typename OperationType >
bool IsOwnerNodeOperation (const rvsdg::Input &input) noexcept
 Checks if the input belongs to a node of the specified operation type. More...
 
template<typename OperationType >
bool IsOwnerNodeOperation (const rvsdg::Output &output) noexcept
 Checks if the output belongs to a node of the specified operation type. More...
 
RegionTryGetOwnerRegion (const rvsdg::Input &input) noexcept
 
RegionTryGetOwnerRegion (const rvsdg::Output &output) noexcept
 
static std::vector< jlm::rvsdg::Output * > operands (const Node *node)
 
static std::vector< jlm::rvsdg::Output * > outputs (const Node *node)
 
static std::vector< Output * > Outputs (const Node &node, const size_t startIdx, const size_t size)
 
static void divert_users (Node *node, const std::vector< Output * > &outputs)
 
template<class TOperation >
std::optional< std::vector< Output * > > NormalizeSequence (const std::vector< NodeNormalization< TOperation >> &nodeNormalizations, const TOperation &operation, const std::vector< Output * > &operands)
 
template<class TOperation >
bool ReduceNode (const NodeNormalization< TOperation > &nodeNormalization, SimpleNode &node)
 
template<class T >
static bool is (const Operation &operation) noexcept
 
std::unordered_map< const Node *, size_t > computeDepthMap (const Region &region)
 
size_t nnodes (const jlm::rvsdg::Region *region) noexcept
 
size_t nstructnodes (const rvsdg::Region *region) noexcept
 
size_t nsimpnodes (const rvsdg::Region *region) noexcept
 
size_t ninputs (const rvsdg::Region *region) noexcept
 
static void remove (Node *node)
 
template<typename NodeType >
NodeType * TryGetRegionParentNode (const rvsdg::Input &input) noexcept
 Checks if this is a result of a region inside a node of specified type. More...
 
template<typename NodeType >
NodeType * TryGetRegionParentNode (const rvsdg::Output &output) noexcept
 Checks if this is an argument of a region inside a node of specified type. More...
 
template<typename NodeType >
NodeType & AssertGetRegionParentNode (const rvsdg::Input &input)
 Asserts that this is a result of a region inside a node of specified type. More...
 
template<typename NodeType >
NodeType & AssertGetRegionParentNode (const rvsdg::Output &output)
 Asserts that this is an argument of a region inside a node of specified type. More...
 
std::optional< std::vector< rvsdg::Output * > > NormalizeSimpleOperationCommonNodeElimination (Region &region, const SimpleOperation &operation, const std::vector< rvsdg::Output * > &operands)
 Performs common node elimination for a given operation and operands in a region. More...
 
template<typename OperatorType , typename... OperatorArguments>
SimpleNodeCreateOpNode (const std::vector< Output * > &operands, OperatorArguments... operatorArguments)
 Creates a simple node characterized by its operator. More...
 
template<typename OperatorType , typename... OperatorArguments>
SimpleNodeCreateOpNode (Region &region, OperatorArguments... operatorArguments)
 Creates a simple node characterized by its operator. More...
 
template<typename TOperation >
std::pair< SimpleNode *, const TOperation * > TryGetSimpleNodeAndOptionalOp (const Input &input) noexcept
 Checks if this is an input to a SimpleNode and of specified operation type. More...
 
template<typename TOperation >
std::pair< SimpleNode *, const TOperation * > TryGetSimpleNodeAndOptionalOp (const Output &output) noexcept
 Checks if this is an output to a SimpleNode and of specified operation type. More...
 
template<typename TOperation >
std::pair< const SimpleNode *, const TOperation * > TryGetSimpleNodeAndOptionalOp (const Node &node) noexcept
 Checks if the node is a SimpleNode of the specified operation type. More...
 
static std::string ToString (const TypeKind kind)
 
static bool ThetaLoopVarIsInvariant (const ThetaNode::LoopVar &loopVar) noexcept
 
static OutputmapGammaArgumentToOrigin (GammaNode &gammaNode, Output &output)
 
OutputtraceOutputIntraProcedurally (Output &output)
 
OutputtraceOutput (Output &output)
 
const OutputtraceOutputIntraProcedurally (const Output &output)
 
const OutputtraceOutput (const Output &output)
 
template<class T >
static bool is (const jlm::rvsdg::Type &type) noexcept
 
template<class T >
static bool is (const std::shared_ptr< const jlm::rvsdg::Type > &type) noexcept
 
std::optional< std::vector< rvsdg::Output * > > NormalizeUnaryOperation (const UnaryOperation &operation, const std::vector< rvsdg::Output * > &operands)
 Applies the reductions implemented in the unary operations reduction functions. More...
 
static std::string region_to_string (const rvsdg::Region *region, size_t depth, std::unordered_map< const Output *, std::string > &)
 
static std::string indent (size_t depth)
 
static std::string create_port_name (const jlm::rvsdg::Output *port, std::unordered_map< const Output *, std::string > &map)
 
static std::string node_to_string (const Node *node, size_t depth, std::unordered_map< const Output *, std::string > &map)
 
static std::string region_header (const rvsdg::Region *region, std::unordered_map< const Output *, std::string > &map)
 
static std::string region_body (const Region *region, const size_t depth, std::unordered_map< const Output *, std::string > &map)
 
static std::string region_footer (const rvsdg::Region *region, std::unordered_map< const Output *, std::string > &map)
 
std::string view (const rvsdg::Region *region)
 
std::string view (const rvsdg::Region *region, std::unordered_map< const Output *, std::string > &map)
 
void view (const rvsdg::Region *region, FILE *out)
 
static std::string xml_header ()
 
static std::string xml_footer ()
 
static std::string id (const jlm::rvsdg::Output *port)
 
static std::string id (const jlm::rvsdg::Input *port)
 
static std::string id (const Node *node)
 
static std::string id (const rvsdg::Region *region)
 
static std::string argument_tag (const std::string &id)
 
static std::string result_tag (const std::string &id)
 
static std::string input_tag (const std::string &id)
 
static std::string output_tag (const std::string &id)
 
static std::string node_starttag (const std::string &id, const std::string &name, const std::string &type)
 
static std::string node_endtag ()
 
static std::string region_starttag (const std::string &id)
 
static std::string region_endtag (const std::string &)
 
static std::string edge_tag (const std::string &srcid, const std::string &dstid)
 
static std::string type (const Node *n)
 
static std::string convert_region (const jlm::rvsdg::Region *region)
 
static std::string convert_simple_node (const jlm::rvsdg::SimpleNode *node)
 
static std::string convert_structural_node (const rvsdg::StructuralNode *node)
 
static std::string convert_node (const Node *node)
 
std::string to_xml (const rvsdg::Region *region)
 
void view_xml (const rvsdg::Region *region, FILE *out)
 
void view (const Graph &graph, FILE *out)
 

Variables

static const binop_reduction_path_t binop_reduction_none = 0
 
static const binop_reduction_path_t binop_reduction_constants = 1
 
static const binop_reduction_path_t binop_reduction_merge = 2
 
static const binop_reduction_path_t binop_reduction_lfold = 3
 
static const binop_reduction_path_t binop_reduction_rfold = 4
 
static const binop_reduction_path_t binop_reduction_lneutral = 5
 
static const binop_reduction_path_t binop_reduction_rneutral = 6
 
static const binop_reduction_path_t binop_reduction_factor = 7
 
const char BitNegateLabel [] = "BitNegate"
 
const char BitNotLabel [] = "BitNot"
 
const char BitAddLabel [] = "BitAdd"
 
const char BitAndLabel [] = "BitAnd"
 
const char BitAShrLabel [] = "BitAShr"
 
const char BitMulLabel [] = "BitMul"
 
const char BitOrLabel [] = "BitOr"
 
const char BitSDivLabel [] = "BitSDiv"
 
const char BitShlLabel [] = "BitShl"
 
const char BitShrLabel [] = "BitShr"
 
const char BitSModLabel [] = "BitSMod"
 
const char BitSMulHLabel [] = "BitSMulH"
 
const char BitSubLabel [] = "BitSub"
 
const char BitUDivLabel [] = "BitUDiv"
 
const char BitUModLabel [] = "BitUMod"
 
const char BitUMulHLabel [] = "BitUMulH"
 
const char BitXorLabel [] = "BitXor"
 
const char BitEqLabel [] = "BitEq"
 
const char BitNeLabel [] = "BitNe"
 
const char BitSgeLabel [] = "BitSge"
 
const char BitSgtLabel [] = "BitSgt"
 
const char BitSleLabel [] = "BitSle"
 
const char BitSltLabel [] = "BitSlt"
 
const char BitUgeLabel [] = "BitUge"
 
const char BitUgtLabel [] = "BitUgt"
 
const char BitUleLabel [] = "BitUle"
 
const char BitUltLabel [] = "BitUlt"
 
static const unop_reduction_path_t unop_reduction_none = 0
 
static const unop_reduction_path_t unop_reduction_constant = 1
 
static const unop_reduction_path_t unop_reduction_idempotent = 2
 
static const unop_reduction_path_t unop_reduction_inverse = 4
 
static const unop_reduction_path_t unop_reduction_narrow = 5
 
static const unop_reduction_path_t unop_reduction_distribute = 6
 

Typedef Documentation

◆ argument_list

Definition at line 89 of file structural-node.hpp.

◆ binop_reduction_path_t

Definition at line 19 of file binary.hpp.

◆ bitadd_op

Definition at line 95 of file arithmetic.hpp.

◆ bitand_op

Definition at line 106 of file arithmetic.hpp.

◆ bitashr_op

Definition at line 117 of file arithmetic.hpp.

◆ biteq_op

Definition at line 54 of file comparison.hpp.

◆ bitmul_op

Definition at line 125 of file arithmetic.hpp.

◆ bitne_op

Definition at line 63 of file comparison.hpp.

◆ bitneg_op

Definition at line 85 of file arithmetic.hpp.

◆ bitnot_op

Definition at line 90 of file arithmetic.hpp.

◆ bitor_op

Definition at line 136 of file arithmetic.hpp.

◆ bitsdiv_op

Definition at line 147 of file arithmetic.hpp.

◆ bitsge_op

Definition at line 72 of file comparison.hpp.

◆ bitsgt_op

Definition at line 80 of file comparison.hpp.

◆ bitshl_op

Definition at line 155 of file arithmetic.hpp.

◆ bitshr_op

Definition at line 160 of file arithmetic.hpp.

◆ bitsle_op

Definition at line 88 of file comparison.hpp.

◆ bitslt_op

Definition at line 96 of file comparison.hpp.

◆ bitsmod_op

Definition at line 165 of file arithmetic.hpp.

◆ bitsmulh_op

Definition at line 173 of file arithmetic.hpp.

◆ bitsub_op

Definition at line 182 of file arithmetic.hpp.

◆ bitudiv_op

Definition at line 187 of file arithmetic.hpp.

◆ bituge_op

Definition at line 104 of file comparison.hpp.

◆ bitugt_op

Definition at line 112 of file comparison.hpp.

◆ bitule_op

Definition at line 120 of file comparison.hpp.

◆ bitult_op

Definition at line 128 of file comparison.hpp.

◆ bitumod_op

Definition at line 195 of file arithmetic.hpp.

◆ bitumulh_op

Definition at line 203 of file arithmetic.hpp.

◆ bitxor_op

Definition at line 212 of file arithmetic.hpp.

◆ BottomUpConstTraverser

Traverser for visiting every node in a const region in a bottom up order.

See also
BottomUpTraverserGeneric

Definition at line 326 of file traverser.hpp.

◆ BottomUpTraverser

Traverser for visiting every node in a region in a bottom up order.

See also
BottomUpTraverserGeneric

Definition at line 320 of file traverser.hpp.

◆ NodeNormalization

template<class TOperation >
using jlm::rvsdg::NodeNormalization = typedef std::function< std::optional<std::vector<Output *> >(const TOperation &, const std::vector<Output *> &)>

Definition at line 24 of file NodeNormalization.hpp.

◆ result_list

Definition at line 115 of file structural-node.hpp.

◆ TopDownConstTraverser

Traverser for visiting every node in a const region in a top down order.

See also
TopDownTraverserGeneric

Definition at line 314 of file traverser.hpp.

◆ TopDownTraverser

Traverser for visiting every node in a region in a top down order.

See also
TopDownTraverserGeneric

Definition at line 308 of file traverser.hpp.

◆ unop_reduction_path_t

Definition at line 18 of file unary.hpp.

Enumeration Type Documentation

◆ compare_result

Enumerator
undecidable 
static_true 
static_false 

Definition at line 85 of file bitoperation-classes.hpp.

◆ TypeKind

enum jlm::rvsdg::TypeKind
strong

The kinds of types supported in rvsdg.

Note: there might be reasons to make this extensible eventually.

Enumerator
Value 

Designate a value type.

Value types represent things that can be created, copied and destroyed at will.

State 

Designate a state type.

State types represent things that exist in mutable form. They cannot be copied, but objects of this kind must be used linearly.

Definition at line 21 of file type.hpp.

Function Documentation

◆ argument_tag()

static std::string jlm::rvsdg::argument_tag ( const std::string &  id)
inlinestatic

Definition at line 201 of file view.cpp.

◆ AssertGetOwnerNode() [1/2]

template<typename NodeType >
NodeType& jlm::rvsdg::AssertGetOwnerNode ( const rvsdg::Input input)
inline

Asserts that this is an input to a node of specified type.

Template Parameters
NodeTypeThe node type to be matched against.
Parameters
inputInput to be checked.
Returns
Owning node of requested type.

Checks if the specified input belongs to a node of requested type. If this is the case, returns a reference to the node of matched type, otherwise throws std::logic_error.

See Inspecting the graph and matching against different operations.

Definition at line 940 of file node.hpp.

◆ AssertGetOwnerNode() [2/2]

template<typename NodeType >
NodeType& jlm::rvsdg::AssertGetOwnerNode ( const rvsdg::Output output)
inline

Asserts that this is an output of a node of specified type.

Template Parameters
NodeTypeThe node type to be matched against.
Parameters
outputOutput to be checked.
Returns
Owning node of requested type.

Checks if the specified output belongs to a node of requested type. If this is the case, returns a reference to the node of matched type, otherwise throws std::logic_error.

See Inspecting the graph and matching against different operations.

Definition at line 970 of file node.hpp.

◆ AssertGetRegionParentNode() [1/2]

template<typename NodeType >
NodeType& jlm::rvsdg::AssertGetRegionParentNode ( const rvsdg::Input input)
inline

Asserts that this is a result of a region inside a node of specified type.

Template Parameters
NodeTypeThe node type to be matched against.
Parameters
inputInput to be checked.
Returns
Node of requested type to which the region belongs.

Checks if the specified input is a region exit result belonging to a node of specified type. If this is the case, returns a reference to the node of matched type, otherwise throws an exception.

See Inspecting the graph and matching against different operations.

Definition at line 1042 of file region.hpp.

◆ AssertGetRegionParentNode() [2/2]

template<typename NodeType >
NodeType& jlm::rvsdg::AssertGetRegionParentNode ( const rvsdg::Output output)
inline

Asserts that this is an argument of a region inside a node of specified type.

Template Parameters
NodeTypeThe node type to be matched against.
Parameters
outputOutput to be checked.
Returns
Node of requested type to which the region belongs.

Checks if the specified input is a region entry argument belonging to a node of specified type. If this is the case, returns a reference to the node of matched type, otherwise throws an exception.

See Inspecting the graph and matching against different operations.

Definition at line 1073 of file region.hpp.

◆ bitconcat()

jlm::rvsdg::Output * jlm::rvsdg::bitconcat ( const std::vector< jlm::rvsdg::Output * > &  operands)

Definition at line 16 of file concat.cpp.

◆ bitslice()

jlm::rvsdg::Output * jlm::rvsdg::bitslice ( jlm::rvsdg::Output operand,
size_t  low,
size_t  high 
)

Create bitslice.

Parameters
operandInput value
lowLow bit
highHigh bit
Returns
Bitstring value representing slice

Convenience function that either creates a new slice or returns the output handle of an existing slice.

Definition at line 106 of file slice.cpp.

◆ computeDepthMap()

std::unordered_map< const Node *, size_t > jlm::rvsdg::computeDepthMap ( const Region region)

Computes the depth for all nodes in region.

Parameters
regionThe region for which to compute the depth of its nodes.
Returns
A dictionary mapping nodes to their depth.

Definition at line 609 of file region.cpp.

◆ ComputeNextInput()

static Input* jlm::rvsdg::ComputeNextInput ( const Input input)
static

Definition at line 100 of file node.cpp.

◆ ComputeNextOutput()

static Output* jlm::rvsdg::ComputeNextOutput ( const Output output)
static

Definition at line 212 of file node.cpp.

◆ convert_node()

static std::string jlm::rvsdg::convert_node ( const Node node)
inlinestatic

Definition at line 317 of file view.cpp.

◆ convert_region()

static std::string jlm::rvsdg::convert_region ( const jlm::rvsdg::Region region)
inlinestatic

Definition at line 330 of file view.cpp.

◆ convert_simple_node()

static std::string jlm::rvsdg::convert_simple_node ( const jlm::rvsdg::SimpleNode node)
inlinestatic

Definition at line 270 of file view.cpp.

◆ convert_structural_node()

static std::string jlm::rvsdg::convert_structural_node ( const rvsdg::StructuralNode node)
inlinestatic

Definition at line 292 of file view.cpp.

◆ create_port_name()

static std::string jlm::rvsdg::create_port_name ( const jlm::rvsdg::Output port,
std::unordered_map< const Output *, std::string > &  map 
)
static

Definition at line 28 of file view.cpp.

◆ CreateOpNode() [1/2]

template<typename OperatorType , typename... OperatorArguments>
SimpleNode& jlm::rvsdg::CreateOpNode ( const std::vector< Output * > &  operands,
OperatorArguments...  operatorArguments 
)

Creates a simple node characterized by its operator.

Template Parameters
OperatorTypeThe type of operator wrapped by the node.
OperatorArgumentsArgument types of the operator to be constructed (should be implied, just specify the OperatorType).
Parameters
operandsThe operands to the operator (i.e. inputs to the node to be constructed).
operatorArgumentsConstructor arguments for the operator to be constructed.
Returns
Reference to the node constructed.
Precondition
operands must be non-empty, must be in the same region, and their types must match the operator constructed by this call.

Constructs a new operator of type OperatorType using operatorArguments as constructor arguments. Creates a simple node using the constructed operator and the given operands as operands to the constructed operator.

Usage example:

auto element_ptr = CreateOpNode<GetElementPtrOperation>(
{ ptr }, offsetTypes, pointeeTypes).outputs(0);
static std::vector< jlm::rvsdg::Output * > outputs(const Node *node)
Definition: node.hpp:1058

Definition at line 128 of file simple-node.hpp.

◆ CreateOpNode() [2/2]

template<typename OperatorType , typename... OperatorArguments>
SimpleNode& jlm::rvsdg::CreateOpNode ( Region region,
OperatorArguments...  operatorArguments 
)

Creates a simple node characterized by its operator.

Template Parameters
OperatorTypeThe type of operator wrapped by the node.
OperatorArgumentsArgument types of the operator to be constructed (should be implied, just specify the OperatorType).
Parameters
regionThe region to create the node in.
operatorArgumentsConstructor arguments for the operator to be constructed.
Returns
Reference to the node constructed.
Precondition
The given operator must not take any operands.

Constructs a new operator of type OperatorType using operatorArguments as constructor arguments. Creates a simple node using the constructed operator with no operands in the specified region.

Usage example:

auto val = CreateOpNode<IntegerConstantOperation>(region, 42).outputs(0);

Definition at line 170 of file simple-node.hpp.

◆ divert_users()

static void jlm::rvsdg::divert_users ( Node node,
const std::vector< Output * > &  outputs 
)
inlinestatic

Definition at line 1090 of file node.hpp.

◆ edge_tag()

static std::string jlm::rvsdg::edge_tag ( const std::string &  srcid,
const std::string &  dstid 
)
inlinestatic

Definition at line 249 of file view.cpp.

◆ FlattenAssociativeBinaryOperation()

std::optional< std::vector< rvsdg::Output * > > jlm::rvsdg::FlattenAssociativeBinaryOperation ( const BinaryOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)

Flattens a cascade of the same binary operations into a single flattened binary operation.

o1 = binaryNode i1 i2 o2 = binaryNode o1 i3 => o2 = flattenedBinaryNode i1 i2 i3

Precondition
The binary operation must be associative.
Parameters
operationThe binary operation on which the transformation is performed.
operandsThe operands of the binary node.
Returns
If the normalization could be applied, then the results of the binary operation after the transformation. Otherwise, std::nullopt.

Definition at line 64 of file binary.cpp.

◆ FlattenBitConcatOperation()

std::optional< std::vector< rvsdg::Output * > > jlm::rvsdg::FlattenBitConcatOperation ( const BitConcatOperation ,
const std::vector< rvsdg::Output * > &  operands 
)

Definition at line 154 of file concat.cpp.

◆ GetGammaInvariantOrigin()

std::optional< rvsdg::Output * > jlm::rvsdg::GetGammaInvariantOrigin ( const GammaNode gamma,
const GammaNode::ExitVar exitvar 
)

Determines whether a gamma exit var is path-invariant.

Parameters
gammaThe gamma node which we are testing for.
exitvarExit variable of the gamma node.
Returns
The common (invariant) origin of this output, or nullopt.
Precondition
exitvar must be an GammaNode::ExitVar of gamma

Checks whether the gamma effectively assigns the same input value to this exit variable on all paths of the gamma. If this is the case, it returns the origin of the common input.

Definition at line 470 of file gamma.cpp.

◆ getSurroundingLambdaNode() [1/2]

const rvsdg::LambdaNode & jlm::rvsdg::getSurroundingLambdaNode ( const rvsdg::Node node)

Definition at line 285 of file lambda.cpp.

◆ getSurroundingLambdaNode() [2/2]

rvsdg::LambdaNode & jlm::rvsdg::getSurroundingLambdaNode ( rvsdg::Node node)

Traverses from the given node up the region hierarchy until a lambda node is found. If the node is itself a lambda node, it is returned.

Parameters
nodethe starting node
Returns
the surrounding lambda node that contains node
Exceptions
std::logic_errorif node is not within a lambda node

Definition at line 272 of file lambda.cpp.

◆ GetTypesFromOperands()

static std::vector<std::shared_ptr<const BitType> > jlm::rvsdg::GetTypesFromOperands ( const std::vector< rvsdg::Output * > &  args)
static

Definition at line 143 of file concat.cpp.

◆ id() [1/4]

static std::string jlm::rvsdg::id ( const jlm::rvsdg::Input port)
inlinestatic

Definition at line 183 of file view.cpp.

◆ id() [2/4]

static std::string jlm::rvsdg::id ( const jlm::rvsdg::Output port)
inlinestatic

Definition at line 177 of file view.cpp.

◆ id() [3/4]

static std::string jlm::rvsdg::id ( const Node node)
inlinestatic

Definition at line 189 of file view.cpp.

◆ id() [4/4]

static std::string jlm::rvsdg::id ( const rvsdg::Region region)
inlinestatic

Definition at line 195 of file view.cpp.

◆ indent()

static std::string jlm::rvsdg::indent ( size_t  depth)
static

Definition at line 22 of file view.cpp.

◆ input_tag()

static std::string jlm::rvsdg::input_tag ( const std::string &  id)
inlinestatic

Definition at line 213 of file view.cpp.

◆ is() [1/6]

template<class T >
static bool jlm::rvsdg::is ( const jlm::rvsdg::Input input)
inlinestaticnoexcept

Definition at line 236 of file node.hpp.

◆ is() [2/6]

template<class T >
static bool jlm::rvsdg::is ( const jlm::rvsdg::Output output)
inlinestaticnoexcept

Definition at line 545 of file node.hpp.

◆ is() [3/6]

template<class T >
static bool jlm::rvsdg::is ( const jlm::rvsdg::Type type)
inlinestaticnoexcept

Definition at line 79 of file type.hpp.

◆ is() [4/6]

template<class OperationType >
bool jlm::rvsdg::is ( const Node node)
inlinenoexcept

Checks if the given node is not null, and has an operation of the specified type.

Template Parameters
OperationTypeThe subclass of operation to check for.
Parameters
nodeThe node being checked.
Returns
true if node has an operation that is an instance of the specified type, otherwise false.

Definition at line 829 of file node.hpp.

◆ is() [5/6]

template<class T >
static bool jlm::rvsdg::is ( const Operation operation)
inlinestaticnoexcept

Definition at line 47 of file operation.hpp.

◆ is() [6/6]

template<class T >
static bool jlm::rvsdg::is ( const std::shared_ptr< const jlm::rvsdg::Type > &  type)
inlinestaticnoexcept

Definition at line 90 of file type.hpp.

◆ is_control_constant_reducible()

static std::unordered_set<jlm::rvsdg::Output *> jlm::rvsdg::is_control_constant_reducible ( GammaNode gamma)
static

Definition at line 77 of file gamma.cpp.

◆ is_predicate_reducible()

static bool jlm::rvsdg::is_predicate_reducible ( const GammaNode gamma)
static

Definition at line 20 of file gamma.cpp.

◆ IsOwnerNodeOperation() [1/2]

template<typename OperationType >
bool jlm::rvsdg::IsOwnerNodeOperation ( const rvsdg::Input input)
noexcept

Checks if the input belongs to a node of the specified operation type.

Template Parameters
OperationTypeThe subclass of Operation to check for.
Parameters
inputThe output being checked.
Returns
True if the input is owned by a node, whose operation is an instance of the specified type. Otherwise, false.

Definition at line 995 of file node.hpp.

◆ IsOwnerNodeOperation() [2/2]

template<typename OperationType >
bool jlm::rvsdg::IsOwnerNodeOperation ( const rvsdg::Output output)
noexcept

Checks if the output belongs to a node of the specified operation type.

Template Parameters
OperationTypeThe subclass of Operation to check for.
Parameters
outputThe output being checked.
Returns
True if the output is owned by a node, whose operation is an instance of the specified type. Otherwise, false.

Definition at line 1015 of file node.hpp.

◆ mapGammaArgumentToOrigin()

static Output& jlm::rvsdg::mapGammaArgumentToOrigin ( GammaNode gammaNode,
Output output 
)
static

Gets the origin of the given gamma subregion argument, outside the gamma node

Parameters
gammaNodethe gamma node
outputan argument in one of gammaNode's subregions
Returns
the origin of the argument outside the gamma node

Definition at line 49 of file Trace.cpp.

◆ match()

jlm::rvsdg::Output * jlm::rvsdg::match ( size_t  nbits,
const std::unordered_map< uint64_t, uint64_t > &  mapping,
uint64_t  default_alternative,
size_t  nalternatives,
jlm::rvsdg::Output operand 
)

Definition at line 179 of file control.cpp.

◆ MatchType() [1/3]

template<typename T , typename... Fns>
void jlm::rvsdg::MatchType ( T &  obj,
const Fns &...  fns 
)

Pattern match over subclass type of given object.

Parameters
objObject to be matched over
fnsFunctions to be attempted, in order.

Each of the callable function objects must take a reference to a subclass of the given object. Pattern matching tries to cast the object to each given subclass in turn, and calls the first applicable handler function

◆ MatchType() [2/3]

template<typename T >
void jlm::rvsdg::MatchType ( T &  x)

Definition at line 129 of file MatchType.hpp.

◆ MatchType() [3/3]

template<typename T , typename Fn , typename... Fns>
void jlm::rvsdg::MatchType ( T &  x,
const Fn &  fn,
const Fns &...  fns 
)

Definition at line 135 of file MatchType.hpp.

◆ MatchTypeOrFail() [1/3]

template<typename T , typename... Fns>
void jlm::rvsdg::MatchTypeOrFail ( T &  obj,
const Fns &...  fns 
)

Pattern match over subclass type of given object.

Parameters
objObject to be matched over
fnsFunctions to be attempted, in order.

Each of the callable function objects must take a reference to a subclass of the given object. Pattern matching tries to cast the object to each given subclass in turn, and calls the first applicable handler function. If no handler function applies, this is considered a logic error (it should never occur).

◆ MatchTypeOrFail() [2/3]

template<typename T , typename Fn >
CallableResultType<Fn>::type jlm::rvsdg::MatchTypeOrFail ( T &  x,
const Fn &  fn 
)

Definition at line 215 of file MatchType.hpp.

◆ MatchTypeOrFail() [3/3]

template<typename T , typename Fn , typename... Fns>
CallableResultType<Fn>::type jlm::rvsdg::MatchTypeOrFail ( T &  x,
const Fn &  fn,
const Fns &...  fns 
)

Definition at line 231 of file MatchType.hpp.

◆ MatchTypeWithDefault() [1/3]

template<typename T , typename Fn >
CallableResultType<Fn>::type jlm::rvsdg::MatchTypeWithDefault ( T &  ,
const Fn &  fn 
)

Definition at line 172 of file MatchType.hpp.

◆ MatchTypeWithDefault() [2/3]

template<typename T , typename... Fns>
void jlm::rvsdg::MatchTypeWithDefault ( T &  obj,
const Fns &...  fns 
)

Pattern match over subclass type of given object with default handler.

Parameters
objObject to be matched over
fnsFunctions to be attempted, in order. Last callable must not take any parameters and is called as failure fallback.

Each of the callable function objects must take a reference to a subclass of the given object. Pattern matching tries to cast the object to each given subclass in turn, and calls the first applicable handler function. The last callable must not take any parameters and will be called when neither of the previous handlers matched.

◆ MatchTypeWithDefault() [3/3]

template<typename T , typename Fn , typename... Fns>
CallableResultType<Fn>::type jlm::rvsdg::MatchTypeWithDefault ( T &  x,
const Fn &  fn,
const Fns &...  fns 
)

Definition at line 180 of file MatchType.hpp.

◆ ninputs()

size_t jlm::rvsdg::ninputs ( const rvsdg::Region region)
noexcept

Definition at line 682 of file region.cpp.

◆ nnodes()

size_t jlm::rvsdg::nnodes ( const jlm::rvsdg::Region region)
noexcept

Definition at line 629 of file region.cpp.

◆ node_endtag()

static std::string jlm::rvsdg::node_endtag ( )
inlinestatic

Definition at line 231 of file view.cpp.

◆ node_starttag()

static std::string jlm::rvsdg::node_starttag ( const std::string &  id,
const std::string &  name,
const std::string &  type 
)
inlinestatic

Definition at line 225 of file view.cpp.

◆ node_to_string()

static std::string jlm::rvsdg::node_to_string ( const Node node,
size_t  depth,
std::unordered_map< const Output *, std::string > &  map 
)
static

Definition at line 38 of file view.cpp.

◆ NormalizeBinaryOperation()

std::optional< std::vector< rvsdg::Output * > > jlm::rvsdg::NormalizeBinaryOperation ( const BinaryOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)

Applies the reductions implemented in the binary operations reduction functions.

Parameters
operationThe binary operation on which the transformation is performed.
operandsThe operands of the binary node.
Returns
If the normalization could be applied, then the results of the binary operation after the transformation. Otherwise, std::nullopt.
See also
binary_op::can_reduce_operand_pair()
binary_op::reduce_operand_pair()

Definition at line 112 of file binary.cpp.

◆ NormalizeFlattenedBinaryOperation()

std::optional< std::vector< rvsdg::Output * > > jlm::rvsdg::NormalizeFlattenedBinaryOperation ( const FlattenedBinaryOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)

Applies the reductions of the binary operation represented by the flattened binary operation.

Parameters
operationThe flattened binary operation on which the transformation is performed.
operandsThe operands of the flattened binary node.
Returns
If the normalization could be applied, then the results of the flattened binary operation after the transformation. Otherwise, std::nullopt.
See also
NormalizeBinaryOperation()

Definition at line 253 of file binary.cpp.

◆ NormalizeSequence()

template<class TOperation >
std::optional<std::vector<Output *> > jlm::rvsdg::NormalizeSequence ( const std::vector< NodeNormalization< TOperation >> &  nodeNormalizations,
const TOperation &  operation,
const std::vector< Output * > &  operands 
)

Definition at line 29 of file NodeNormalization.hpp.

◆ NormalizeSimpleOperationCommonNodeElimination()

std::optional< std::vector< rvsdg::Output * > > jlm::rvsdg::NormalizeSimpleOperationCommonNodeElimination ( Region region,
const SimpleOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)

Performs common node elimination for a given operation and operands in a region.

Parameters
regionThe region in which common node elimination is performed.
operationThe simple operation on which the transformation is performed.
operandsThe operands of the simple node.
Returns
If the normalization could be applied, then the results of the binary operation after the transformation. Otherwise, std::nullopt.

Definition at line 85 of file simple-node.cpp.

◆ NormalizeUnaryOperation()

std::optional< std::vector< rvsdg::Output * > > jlm::rvsdg::NormalizeUnaryOperation ( const UnaryOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)

Applies the reductions implemented in the unary operations reduction functions.

Parameters
operationThe unary operation on which the transformation is performed.
operandsThe single(!) operand of the unary node. It should only be a single operand.
Returns
If the normalization could be applied, then the single(!) result of the unary operation after the transformation. Otherwise, std::nullopt.
See also
unary_op::can_reduce_operand()
unary_op::reduce_operand()

Definition at line 17 of file unary.cpp.

◆ nsimpnodes()

size_t jlm::rvsdg::nsimpnodes ( const rvsdg::Region region)
noexcept

Definition at line 662 of file region.cpp.

◆ nstructnodes()

size_t jlm::rvsdg::nstructnodes ( const rvsdg::Region region)
noexcept

Definition at line 645 of file region.cpp.

◆ operands()

static std::vector<jlm::rvsdg::Output *> jlm::rvsdg::operands ( const Node node)
inlinestatic

Definition at line 1049 of file node.hpp.

◆ operator&()

static constexpr enum BinaryOperation::flags jlm::rvsdg::operator& ( enum BinaryOperation::flags  a,
enum BinaryOperation::flags  b 
)
staticconstexpr

Definition at line 171 of file binary.hpp.

◆ operator|()

static constexpr enum BinaryOperation::flags jlm::rvsdg::operator| ( enum BinaryOperation::flags  a,
enum BinaryOperation::flags  b 
)
staticconstexpr

Definition at line 171 of file binary.hpp.

◆ output_tag()

static std::string jlm::rvsdg::output_tag ( const std::string &  id)
inlinestatic

Definition at line 219 of file view.cpp.

◆ Outputs()

static std::vector<Output *> jlm::rvsdg::Outputs ( const Node node,
const size_t  startIdx,
const size_t  size 
)
inlinestatic

Returns a subset of the outputs from a node as a vector.

Parameters
nodeThe node from which the outputs are taken.
startIdxThe index of the first output.
sizeThe number of outputs that are returned.
Returns
A vector of outputs.
Precondition
The startIdx + size must be smaller or equal than the number of outputs of node.

Definition at line 1077 of file node.hpp.

◆ outputs()

static std::vector<jlm::rvsdg::Output *> jlm::rvsdg::outputs ( const Node node)
inlinestatic

Definition at line 1058 of file node.hpp.

◆ perform_control_constant_reduction()

static void jlm::rvsdg::perform_control_constant_reduction ( std::unordered_set< jlm::rvsdg::Output * > &  outputs)
static

Definition at line 119 of file gamma.cpp.

◆ perform_invariant_reduction()

static bool jlm::rvsdg::perform_invariant_reduction ( GammaNode gamma)
static

Definition at line 47 of file gamma.cpp.

◆ perform_predicate_reduction()

static void jlm::rvsdg::perform_predicate_reduction ( GammaNode gamma)
static

Definition at line 27 of file gamma.cpp.

◆ reduce_linear()

static jlm::rvsdg::Output* jlm::rvsdg::reduce_linear ( const BinaryOperation op,
const std::vector< jlm::rvsdg::Output * > &  operands 
)
static

Definition at line 187 of file binary.cpp.

◆ reduce_parallel()

static jlm::rvsdg::Output* jlm::rvsdg::reduce_parallel ( const BinaryOperation op,
const std::vector< jlm::rvsdg::Output * > &  operands 
)
static

Definition at line 165 of file binary.cpp.

◆ ReduceGammaControlConstant()

bool jlm::rvsdg::ReduceGammaControlConstant ( Node node)

Reduces the predicate of a gamma node g1 from the constants that originate from another gamma node g2 to the predicate of g2.

p2 = gamma p1 [] x = 0 [p2 <= x] [] y = 1 [p2 <= y] ... = gamma p2 => p2 = gamma p1 [] x = 0 [p2 <= x] [] y = 1 [p2 <= y] ... = gamma p1

Parameters
nodeA gamma node that is supposed to be reduced.
Returns
True, if the transformation was successful, otherwise false.

Definition at line 171 of file gamma.cpp.

◆ ReduceGammaInvariantVariables()

bool jlm::rvsdg::ReduceGammaInvariantVariables ( Node node)

Reduces all invariant variables of gamma node and diverts the users of the gamma node's exit variables to the respective origin of the invariant variable. x = ... xo = gamma p xi [xa <= xi] [xr <= xa] [xa <= xi] [xr <= xa] ... = anyOp xo => x = ... xo = gamma p xi [xa <= xi] [xo <= xa] [xa <= xi] [xo <= xa] ... = anyOp x //xo changed to x

Parameters
nodeA gamma node that is supposed to be reduced.
Returns
True, if the transformation was successful, otherwise false.

Definition at line 186 of file gamma.cpp.

◆ ReduceGammaWithStaticallyKnownPredicate()

bool jlm::rvsdg::ReduceGammaWithStaticallyKnownPredicate ( Node node)

Reduces a gamma node with a statically known predicate to the respective subregion determined by the value of the predicate.

c = gamma 0 [] x = 45 [c <= x] [] y = 37 [c <= y] ... = add c + 5 => c = 45 ... = add c + 5

Parameters
nodeA gamma node that is supposed to be reduced.
Returns
True, if transformation was successful, otherwise false.

Definition at line 158 of file gamma.cpp.

◆ ReduceNode()

template<class TOperation >
bool jlm::rvsdg::ReduceNode ( const NodeNormalization< TOperation > &  nodeNormalization,
SimpleNode node 
)

Definition at line 47 of file NodeNormalization.hpp.

◆ region_body()

static std::string jlm::rvsdg::region_body ( const Region region,
const size_t  depth,
std::unordered_map< const Output *, std::string > &  map 
)
static

Definition at line 93 of file view.cpp.

◆ region_endtag()

static std::string jlm::rvsdg::region_endtag ( const std::string &  )
inlinestatic

Definition at line 243 of file view.cpp.

◆ region_footer()

static std::string jlm::rvsdg::region_footer ( const rvsdg::Region region,
std::unordered_map< const Output *, std::string > &  map 
)
static

Definition at line 108 of file view.cpp.

◆ region_header()

static std::string jlm::rvsdg::region_header ( const rvsdg::Region region,
std::unordered_map< const Output *, std::string > &  map 
)
static

Definition at line 71 of file view.cpp.

◆ region_starttag()

static std::string jlm::rvsdg::region_starttag ( const std::string &  id)
inlinestatic

Definition at line 237 of file view.cpp.

◆ region_to_string()

static std::string jlm::rvsdg::region_to_string ( const rvsdg::Region region,
size_t  depth,
std::unordered_map< const Output *, std::string > &  map 
)
static

Definition at line 129 of file view.cpp.

◆ remove()

static void jlm::rvsdg::remove ( Node node)
inlinestatic

Definition at line 932 of file region.hpp.

◆ result_tag()

static std::string jlm::rvsdg::result_tag ( const std::string &  id)
inlinestatic

Definition at line 207 of file view.cpp.

◆ RouteToRegion()

Output & jlm::rvsdg::RouteToRegion ( Output output,
Region region 
)

Routes output through the region tree to region by creating the necessary inputs and region arguments for the encountered nodes.

Note
The function throws an exception if the region of output is not an ancestor of region.
Parameters
outputThe value that is supposed to be routed to region.
regionThe region the value is supposed to be routed to.
Returns
The routed value in region.

Definition at line 381 of file node.cpp.

◆ ThetaLoopVarIsInvariant()

static bool jlm::rvsdg::ThetaLoopVarIsInvariant ( const ThetaNode::LoopVar loopVar)
inlinestaticnoexcept

Definition at line 227 of file theta.hpp.

◆ to_xml()

std::string jlm::rvsdg::to_xml ( const rvsdg::Region region)

Definition at line 357 of file view.cpp.

◆ ToString()

static std::string jlm::rvsdg::ToString ( const TypeKind  kind)
static

Definition at line 17 of file TestType.cpp.

◆ traceOutput() [1/2]

const Output& jlm::rvsdg::traceOutput ( const Output output)
inline

Definition at line 211 of file Trace.hpp.

◆ traceOutput() [2/2]

Output & jlm::rvsdg::traceOutput ( Output output)

Traces output through the RVSDG. The function is capable of tracing through everything traceOutputIntraProcedurally is, in addition to:

  1. From lambda context variables out of the lambda
  2. From delta context variables out of the delta
  3. From phi context variables out of the phi
  4. From phi outputs into the phi subregion

It will not trace through phi recursion variables

Parameters
outputthe output to trace.
Returns
the final value of the tracing

Definition at line 231 of file Trace.cpp.

◆ traceOutputIntraProcedurally() [1/2]

const Output& jlm::rvsdg::traceOutputIntraProcedurally ( const Output output)
inline

Definition at line 187 of file Trace.hpp.

◆ traceOutputIntraProcedurally() [2/2]

Output & jlm::rvsdg::traceOutputIntraProcedurally ( Output output)

Traces output intra-procedurally through the RVSDG. The function is capable of tracing:

  1. Through gamma nodes if the exit variable is invariant
  2. Out of gamma nodes from entry variable arguments
  3. Through theta nodes if the loop variable is invariant
  4. Out of theta nodes from the arguments, if the loop variable is invariant

Tracing stops when a lambda function argument or context argument is reached.

Parameters
outputThe Output that needs to be traced.
Returns
The final value of the tracing.

Definition at line 223 of file Trace.cpp.

◆ tryGetOperation()

template<typename TOperation >
const TOperation* jlm::rvsdg::tryGetOperation ( const Node node)
noexcept

Attempts to get the operation of the given node, if the operation is of the given type.

Template Parameters
TOperationthe type of the operation
Parameters
nodethe node
Returns
the node's operation, or nullptr if the node has an operation of the wrong type.

Definition at line 845 of file node.hpp.

◆ TryGetOwnerNode() [1/2]

template<typename NodeType >
NodeType* jlm::rvsdg::TryGetOwnerNode ( const rvsdg::Input input)
inlinenoexcept

Checks if this is an input to a node of specified type.

Template Parameters
NodeTypeThe node type to be matched against.
Parameters
inputInput to be checked.
Returns
Owning node of requested type or nullptr.

Checks if the specified input belongs to a node of requested type. If this is the case, returns a pointer to the node of matched type. If this is not the case (because either this as a region exit result or its owning node is not of the requested type), returns nullptr.

See Inspecting the graph and matching against different operations.

Definition at line 872 of file node.hpp.

◆ TryGetOwnerNode() [2/2]

template<typename NodeType >
NodeType* jlm::rvsdg::TryGetOwnerNode ( const rvsdg::Output output)
inlinenoexcept

Checks if this is an output to a node of specified type.

Template Parameters
NodeTypeThe node type to be matched against.
Parameters
outputOutput to be checked.
Returns
Owning node of requested type or nullptr.

Checks if the specified output belongs to a node of requested type. If this is the case, returns a pointer to the node of matched type. If this is not the case (because either this as a region entry argument or its owning node is not of the requested type), returns nullptr.

See Inspecting the graph and matching against different operations.

Definition at line 907 of file node.hpp.

◆ TryGetOwnerRegion() [1/2]

Region* jlm::rvsdg::TryGetOwnerRegion ( const rvsdg::Input input)
inlinenoexcept

Definition at line 1021 of file node.hpp.

◆ TryGetOwnerRegion() [2/2]

Region* jlm::rvsdg::TryGetOwnerRegion ( const rvsdg::Output output)
inlinenoexcept

Definition at line 1035 of file node.hpp.

◆ TryGetRegionParentNode() [1/2]

template<typename NodeType >
NodeType* jlm::rvsdg::TryGetRegionParentNode ( const rvsdg::Input input)
inlinenoexcept

Checks if this is a result of a region inside a node of specified type.

Template Parameters
NodeTypeThe node type to be matched against.
Parameters
inputInput to be checked.
Returns
Node of requested type to which the region belongs.

Checks if the specified input is a region exit result belonging to a node of specified type. If this is the case, returns a pointer to the node of matched type. If this is not the case (because either this is an input to a node or or because the node owning the region is of a different kind, or because this is the root region), returns nullptr.

See Inspecting the graph and matching against different operations.

Definition at line 972 of file region.hpp.

◆ TryGetRegionParentNode() [2/2]

template<typename NodeType >
NodeType* jlm::rvsdg::TryGetRegionParentNode ( const rvsdg::Output output)
inlinenoexcept

Checks if this is an argument of a region inside a node of specified type.

Template Parameters
NodeTypeThe node type to be matched against.
Parameters
outputOutput to be checked.
Returns
Node of requested type to which the region belongs.

Checks if the specified input is a region entry argument belonging to a node of specified type. If this is the case, returns a pointer to the node of matched type. If this is not the case (because either this is an input to a node or or because the node owning the region is of a different kind, or because this is the root region), returns nullptr.

See Inspecting the graph and matching against different operations.

Definition at line 1008 of file region.hpp.

◆ TryGetSimpleNodeAndOptionalOp() [1/3]

template<typename TOperation >
std::pair<SimpleNode *, const TOperation *> jlm::rvsdg::TryGetSimpleNodeAndOptionalOp ( const Input input)
noexcept

Checks if this is an input to a SimpleNode and of specified operation type.

Template Parameters
TOperationThe operation type to be matched against.
Parameters
inputInput to be checked.
Returns
A pair of the owning simple node and requested operation. If the owner of input is not a SimpleNode, then <nullptr, nullptr> is returned. If the owner of input is a SimpleNode but not of the correct operation type, then <SimpleNode*, nullptr> are returned. Otherwise, <SimpleNode*, TOperation*> are returned.

Checks if the specified input belongs to a SimpleNode of requested operation type. If this is the case, returns a pair of pointers to the node and operation of matched type.

See Inspecting the graph and matching against different operations.

Definition at line 200 of file simple-node.hpp.

◆ TryGetSimpleNodeAndOptionalOp() [2/3]

template<typename TOperation >
std::pair<const SimpleNode *, const TOperation *> jlm::rvsdg::TryGetSimpleNodeAndOptionalOp ( const Node node)
noexcept

Checks if the node is a SimpleNode of the specified operation type.

Template Parameters
TOperationThe operation type to be matched against.
Parameters
nodeNode to be checked.
Returns
A pair of the simple node and requested operation. If node is not a SimpleNode, then <nullptr, nullptr> is returned. If is a SimpleNode of a different operation type, then <SimpleNode*, nullptr> is returned. Otherwise, <SimpleNode*, TOperation*> is returned.

Checks if the specified node is a SimpleNode of the requested operation type. If this is the case, returns a pair of pointers to the SimpleNode and operation.

See Inspecting the graph and matching against different operations.

Definition at line 275 of file simple-node.hpp.

◆ TryGetSimpleNodeAndOptionalOp() [3/3]

template<typename TOperation >
std::pair<SimpleNode *, const TOperation *> jlm::rvsdg::TryGetSimpleNodeAndOptionalOp ( const Output output)
noexcept

Checks if this is an output to a SimpleNode and of specified operation type.

Template Parameters
TOperationThe operation type to be matched against.
Parameters
outputOutput to be checked.
Returns
A pair of the owning simple node and requested operation. If the owner of output is not a SimpleNode, then <nullptr, nullptr> is returned. If the owner of output is a SimpleNode but not of the correct operation type, then <SimpleNode*, nullptr> are returned. Otherwise, <SimpleNode*, TOperation*> are returned.

Checks if the specified output belongs to a SimpleNode of requested operation type. If this is the case, returns a pair of pointers to the node and operation of matched type.

See Inspecting the graph and matching against different operations.

Definition at line 238 of file simple-node.hpp.

◆ type()

static std::string jlm::rvsdg::type ( const Node n)
inlinestatic

Definition at line 255 of file view.cpp.

◆ view() [1/4]

void jlm::rvsdg::view ( const Graph graph,
FILE *  out 
)
inline

Recursively traverses and prints the root region of the given rvsdg graph to the given file.

Parameters
graphthe rvsdg graph to be printed.
outthe file to be written to.

Definition at line 55 of file view.hpp.

◆ view() [2/4]

std::string jlm::rvsdg::view ( const rvsdg::Region region)

Prints the given rvsdg region to a string, through recursive traversal of nodes and subregions. All outputs are given unique names to show dataflow in the graph.

Parameters
regionthe region to be printed
Returns
the string describing the region.
See also
view(region, map)

Definition at line 142 of file view.cpp.

◆ view() [3/4]

void jlm::rvsdg::view ( const rvsdg::Region region,
FILE *  out 
)

Recursively traverses and prints the given rvsdg region to the given file.

Parameters
regionthe region to be printed.
outthe file to be written to.

Definition at line 155 of file view.cpp.

◆ view() [4/4]

std::string jlm::rvsdg::view ( const rvsdg::Region region,
std::unordered_map< const Output *, std::string > &  map 
)

Prints the given rvsdg region to a string, and exposes the unique name given to each output.

Parameters
regionthe region to be printed
mapthe map where each rvsdg::output is mapped to its unique name. Outputs without names will have a name added.
Returns
the string describing the region.

Definition at line 149 of file view.cpp.

◆ view_xml()

void jlm::rvsdg::view_xml ( const rvsdg::Region region,
FILE *  out 
)

Definition at line 369 of file view.cpp.

◆ xml_footer()

static std::string jlm::rvsdg::xml_footer ( )
inlinestatic

Definition at line 171 of file view.cpp.

◆ xml_header()

static std::string jlm::rvsdg::xml_header ( )
inlinestatic

Definition at line 164 of file view.cpp.

Variable Documentation

◆ binop_reduction_constants

const binop_reduction_path_t jlm::rvsdg::binop_reduction_constants = 1
static

Definition at line 205 of file binary.hpp.

◆ binop_reduction_factor

const binop_reduction_path_t jlm::rvsdg::binop_reduction_factor = 7
static

Definition at line 217 of file binary.hpp.

◆ binop_reduction_lfold

const binop_reduction_path_t jlm::rvsdg::binop_reduction_lfold = 3
static

Definition at line 209 of file binary.hpp.

◆ binop_reduction_lneutral

const binop_reduction_path_t jlm::rvsdg::binop_reduction_lneutral = 5
static

Definition at line 213 of file binary.hpp.

◆ binop_reduction_merge

const binop_reduction_path_t jlm::rvsdg::binop_reduction_merge = 2
static

Definition at line 207 of file binary.hpp.

◆ binop_reduction_none

const binop_reduction_path_t jlm::rvsdg::binop_reduction_none = 0
static

Definition at line 203 of file binary.hpp.

◆ binop_reduction_rfold

const binop_reduction_path_t jlm::rvsdg::binop_reduction_rfold = 4
static

Definition at line 211 of file binary.hpp.

◆ binop_reduction_rneutral

const binop_reduction_path_t jlm::rvsdg::binop_reduction_rneutral = 6
static

Definition at line 215 of file binary.hpp.

◆ BitAddLabel

const char jlm::rvsdg::BitAddLabel = "BitAdd"

Definition at line 54 of file arithmetic.cpp.

◆ BitAndLabel

const char jlm::rvsdg::BitAndLabel = "BitAnd"

Definition at line 69 of file arithmetic.cpp.

◆ BitAShrLabel

const char jlm::rvsdg::BitAShrLabel = "BitAShr"

Definition at line 84 of file arithmetic.cpp.

◆ BitEqLabel

const char jlm::rvsdg::BitEqLabel = "BitEq"

Definition at line 22 of file comparison.cpp.

◆ BitMulLabel

const char jlm::rvsdg::BitMulLabel = "BitMul"

Definition at line 96 of file arithmetic.cpp.

◆ BitNegateLabel

const char jlm::rvsdg::BitNegateLabel = "BitNegate"

Definition at line 30 of file arithmetic.cpp.

◆ BitNeLabel

const char jlm::rvsdg::BitNeLabel = "BitNe"

Definition at line 37 of file comparison.cpp.

◆ BitNotLabel

const char jlm::rvsdg::BitNotLabel = "BitNot"

Definition at line 42 of file arithmetic.cpp.

◆ BitOrLabel

const char jlm::rvsdg::BitOrLabel = "BitOr"

Definition at line 111 of file arithmetic.cpp.

◆ BitSDivLabel

const char jlm::rvsdg::BitSDivLabel = "BitSDiv"

Definition at line 126 of file arithmetic.cpp.

◆ BitSgeLabel

const char jlm::rvsdg::BitSgeLabel = "BitSge"

Definition at line 52 of file comparison.cpp.

◆ BitSgtLabel

const char jlm::rvsdg::BitSgtLabel = "BitSgt"

Definition at line 64 of file comparison.cpp.

◆ BitShlLabel

const char jlm::rvsdg::BitShlLabel = "BitShl"

Definition at line 138 of file arithmetic.cpp.

◆ BitShrLabel

const char jlm::rvsdg::BitShrLabel = "BitShr"

Definition at line 150 of file arithmetic.cpp.

◆ BitSleLabel

const char jlm::rvsdg::BitSleLabel = "BitSle"

Definition at line 76 of file comparison.cpp.

◆ BitSltLabel

const char jlm::rvsdg::BitSltLabel = "BitSlt"

Definition at line 88 of file comparison.cpp.

◆ BitSModLabel

const char jlm::rvsdg::BitSModLabel = "BitSMod"

Definition at line 162 of file arithmetic.cpp.

◆ BitSMulHLabel

const char jlm::rvsdg::BitSMulHLabel = "BitSMulH"

Definition at line 174 of file arithmetic.cpp.

◆ BitSubLabel

const char jlm::rvsdg::BitSubLabel = "BitSub"

Definition at line 189 of file arithmetic.cpp.

◆ BitUDivLabel

const char jlm::rvsdg::BitUDivLabel = "BitUDiv"

Definition at line 201 of file arithmetic.cpp.

◆ BitUgeLabel

const char jlm::rvsdg::BitUgeLabel = "BitUge"

Definition at line 100 of file comparison.cpp.

◆ BitUgtLabel

const char jlm::rvsdg::BitUgtLabel = "BitUgt"

Definition at line 112 of file comparison.cpp.

◆ BitUleLabel

const char jlm::rvsdg::BitUleLabel = "BitUle"

Definition at line 124 of file comparison.cpp.

◆ BitUltLabel

const char jlm::rvsdg::BitUltLabel = "BitUlt"

Definition at line 136 of file comparison.cpp.

◆ BitUModLabel

const char jlm::rvsdg::BitUModLabel = "BitUMod"

Definition at line 213 of file arithmetic.cpp.

◆ BitUMulHLabel

const char jlm::rvsdg::BitUMulHLabel = "BitUMulH"

Definition at line 225 of file arithmetic.cpp.

◆ BitXorLabel

const char jlm::rvsdg::BitXorLabel = "BitXor"

Definition at line 240 of file arithmetic.cpp.

◆ unop_reduction_constant

const unop_reduction_path_t jlm::rvsdg::unop_reduction_constant = 1
static

Definition at line 45 of file unary.hpp.

◆ unop_reduction_distribute

const unop_reduction_path_t jlm::rvsdg::unop_reduction_distribute = 6
static

Definition at line 53 of file unary.hpp.

◆ unop_reduction_idempotent

const unop_reduction_path_t jlm::rvsdg::unop_reduction_idempotent = 2
static

Definition at line 47 of file unary.hpp.

◆ unop_reduction_inverse

const unop_reduction_path_t jlm::rvsdg::unop_reduction_inverse = 4
static

Definition at line 49 of file unary.hpp.

◆ unop_reduction_narrow

const unop_reduction_path_t jlm::rvsdg::unop_reduction_narrow = 5
static

Definition at line 51 of file unary.hpp.

◆ unop_reduction_none

const unop_reduction_path_t jlm::rvsdg::unop_reduction_none = 0
static

Definition at line 43 of file unary.hpp.