19 nalternatives_(nalternatives)
49std::shared_ptr<const ControlType>
65 throw util::Error(
"Alternatives of a control type must be non-zero.");
67 return std::shared_ptr<const ControlType>(
68 std::shared_ptr<void>(),
78 : alternative_(alternative),
79 nalternatives_(nalternatives)
82 throw util::Error(
"Alternative is bigger than the number of possible alternatives.");
89 value_(std::
move(value))
96 return operation && operation->
value_ == value_;
105std::unique_ptr<Operation>
108 return std::make_unique<ControlConstantOperation>(
value_);
117 size_t nalternatives)
119 default_alternative_(default_alternative),
128 &&
op->nbits() == nbits() &&
op->nalternatives() == nalternatives();
135 std::ostringstream
oss;
152 return "MATCH[" +
oss.str() +
"]";
155std::unique_ptr<Operation>
158 return std::make_unique<MatchOperation>(*
this);
ControlValueRepresentation value_
~ControlConstantOperation() noexcept override
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
bool operator==(const Operation &other) const noexcept override
std::string debug_string() const override
std::size_t ComputeHash() const noexcept override
~ControlType() noexcept override
bool operator==(const jlm::rvsdg::Type &other) const noexcept override
size_t nalternatives() const noexcept
TypeKind Kind() const noexcept override
Return the kind of this type.
static std::shared_ptr< const ControlType > Create(std::size_t nalternatives)
Instantiates control type.
ControlValueRepresentation(size_t alternative, size_t nalternatives)
size_t nalternatives() const noexcept
size_t alternative() const noexcept
std::unordered_map< uint64_t, uint64_t > mapping_
~MatchOperation() noexcept override
bool operator==(const Operation &other) const noexcept override
uint64_t default_alternative_
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
Nullary operator (operator taking no formal arguments)
TypeKind
The kinds of types supported in rvsdg.
@ Value
Designate a value type.
NodeType * TryGetOwnerNode(const rvsdg::Input &input) noexcept
Checks if this is an input to a node of specified type.
static std::string strfmt(Args... args)
std::size_t CombineHashes(std::size_t hash, Args... args)