Jlm
Public Member Functions | Static Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
jlm::rvsdg::MatchOperation Class Referencefinal

#include <control.hpp>

Inheritance diagram for jlm::rvsdg::MatchOperation:
Inheritance graph
[legend]
Collaboration diagram for jlm::rvsdg::MatchOperation:
Collaboration graph
[legend]

Public Member Functions

 ~MatchOperation () noexcept override
 
 MatchOperation (size_t nbits, const std::unordered_map< uint64_t, uint64_t > &mapping, uint64_t default_alternative, size_t nalternatives)
 
bool operator== (const Operation &other) const noexcept override
 
unop_reduction_path_t can_reduce_operand (const jlm::rvsdg::Output *arg) const noexcept override
 
jlm::rvsdg::Outputreduce_operand (unop_reduction_path_t path, jlm::rvsdg::Output *arg) const override
 
std::string debug_string () const override
 
std::unique_ptr< Operationcopy () const override
 
uint64_t nalternatives () const noexcept
 
uint64_t alternative (uint64_t value) const noexcept
 
uint64_t default_alternative () const noexcept
 
size_t nbits () const noexcept
 
const_iterator begin () const
 
const_iterator end () const
 
- Public Member Functions inherited from jlm::rvsdg::UnaryOperation
 ~UnaryOperation () noexcept override
 
 UnaryOperation (std::shared_ptr< const jlm::rvsdg::Type > operand, std::shared_ptr< const jlm::rvsdg::Type > result)
 
- Public Member Functions inherited from jlm::rvsdg::SimpleOperation
 ~SimpleOperation () noexcept override
 
 SimpleOperation (std::vector< std::shared_ptr< const jlm::rvsdg::Type >> operands, std::vector< std::shared_ptr< const jlm::rvsdg::Type >> results)
 
size_t narguments () const noexcept
 
const std::shared_ptr< const rvsdg::Type > & argument (size_t index) const noexcept
 
size_t nresults () const noexcept
 
const std::shared_ptr< const rvsdg::Type > & result (size_t index) const noexcept
 
- Public Member Functions inherited from jlm::rvsdg::Operation
virtual ~Operation () noexcept
 
bool operator!= (const Operation &other) const noexcept
 

Static Public Member Functions

static NodeCreateNode (Output &predicate, const std::unordered_map< uint64_t, uint64_t > &mapping, const uint64_t defaultAlternative, const size_t numAlternatives)
 
static OutputCreate (Output &predicate, const std::unordered_map< uint64_t, uint64_t > &mapping, const uint64_t defaultAlternative, const size_t numAlternatives)
 

Private Types

typedef std::unordered_map< uint64_t, uint64_t >::const_iterator const_iterator
 

Static Private Member Functions

static const BitTypeCheckAndExtractBitType (const rvsdg::Type &type)
 

Private Attributes

uint64_t default_alternative_
 
std::unordered_map< uint64_t, uint64_t > mapping_
 

Detailed Description

Match operator Converts an n-bit integer input into a value of type ControlType. The ControlType has a given number of alternative values, which are indexed starting at 0. The match can represent any mapping from integers to alternatives, with a default alternative. These alternatives represent the different outgoing edges from a basic block, or the different regions of a gamma node.

Definition at line 157 of file control.hpp.

Member Typedef Documentation

◆ const_iterator

typedef std::unordered_map<uint64_t, uint64_t>::const_iterator jlm::rvsdg::MatchOperation::const_iterator
private

Definition at line 159 of file control.hpp.

Constructor & Destructor Documentation

◆ ~MatchOperation()

jlm::rvsdg::MatchOperation::~MatchOperation ( )
overridedefaultnoexcept

◆ MatchOperation()

jlm::rvsdg::MatchOperation::MatchOperation ( size_t  nbits,
const std::unordered_map< uint64_t, uint64_t > &  mapping,
uint64_t  default_alternative,
size_t  nalternatives 
)

Definition at line 113 of file control.cpp.

Member Function Documentation

◆ alternative()

uint64_t jlm::rvsdg::MatchOperation::alternative ( uint64_t  value) const
inlinenoexcept

Definition at line 192 of file control.hpp.

◆ begin()

const_iterator jlm::rvsdg::MatchOperation::begin ( ) const
inline

Definition at line 214 of file control.hpp.

◆ can_reduce_operand()

unop_reduction_path_t jlm::rvsdg::MatchOperation::can_reduce_operand ( const jlm::rvsdg::Output arg) const
overridevirtualnoexcept

Implements jlm::rvsdg::UnaryOperation.

Definition at line 132 of file control.cpp.

◆ CheckAndExtractBitType()

static const BitType& jlm::rvsdg::MatchOperation::CheckAndExtractBitType ( const rvsdg::Type type)
inlinestaticprivate

Definition at line 253 of file control.hpp.

◆ copy()

std::unique_ptr< Operation > jlm::rvsdg::MatchOperation::copy ( ) const
overridevirtual

Implements jlm::rvsdg::Operation.

Definition at line 173 of file control.cpp.

◆ Create()

static Output* jlm::rvsdg::MatchOperation::Create ( Output predicate,
const std::unordered_map< uint64_t, uint64_t > &  mapping,
const uint64_t  defaultAlternative,
const size_t  numAlternatives 
)
inlinestatic

Definition at line 242 of file control.hpp.

◆ CreateNode()

static Node& jlm::rvsdg::MatchOperation::CreateNode ( Output predicate,
const std::unordered_map< uint64_t, uint64_t > &  mapping,
const uint64_t  defaultAlternative,
const size_t  numAlternatives 
)
inlinestatic

Definition at line 226 of file control.hpp.

◆ debug_string()

std::string jlm::rvsdg::MatchOperation::debug_string ( ) const
overridevirtual

Implements jlm::rvsdg::Operation.

Definition at line 162 of file control.cpp.

◆ default_alternative()

uint64_t jlm::rvsdg::MatchOperation::default_alternative ( ) const
inlinenoexcept

Definition at line 202 of file control.hpp.

◆ end()

const_iterator jlm::rvsdg::MatchOperation::end ( ) const
inline

Definition at line 220 of file control.hpp.

◆ nalternatives()

uint64_t jlm::rvsdg::MatchOperation::nalternatives ( ) const
inlinenoexcept

Definition at line 186 of file control.hpp.

◆ nbits()

size_t jlm::rvsdg::MatchOperation::nbits ( ) const
inlinenoexcept

Definition at line 208 of file control.hpp.

◆ operator==()

bool jlm::rvsdg::MatchOperation::operator== ( const Operation other) const
overridevirtualnoexcept

Implements jlm::rvsdg::Operation.

Definition at line 124 of file control.cpp.

◆ reduce_operand()

jlm::rvsdg::Output * jlm::rvsdg::MatchOperation::reduce_operand ( unop_reduction_path_t  path,
jlm::rvsdg::Output arg 
) const
overridevirtual

Implements jlm::rvsdg::UnaryOperation.

Definition at line 145 of file control.cpp.

Member Data Documentation

◆ default_alternative_

uint64_t jlm::rvsdg::MatchOperation::default_alternative_
private

Definition at line 263 of file control.hpp.

◆ mapping_

std::unordered_map<uint64_t, uint64_t> jlm::rvsdg::MatchOperation::mapping_
private

Definition at line 264 of file control.hpp.


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