6#ifndef JLM_RVSDG_SIMPLE_NODE_HPP
7#define JLM_RVSDG_SIMPLE_NODE_HPP
26 std::unique_ptr<SimpleOperation> operation,
27 const std::vector<jlm::rvsdg::Output *> &
operands);
31 input(
size_t index)
const noexcept;
34 output(
size_t index)
const noexcept;
51 std::unique_ptr<Operation> operation,
52 const std::vector<rvsdg::Output *> &
operands)
55 throw util::Error(
"Expected operation derived from SimpleOperation");
58 util::assertedCast<SimpleOperation>(operation.release()));
75std::optional<std::vector<rvsdg::Output *>>
79 const std::vector<rvsdg::Output *> &
operands);
198template<
typename TOperation>
199[[
nodiscard]] std::pair<SimpleNode *, const TOperation *>
205 return std::make_pair(
nullptr,
nullptr);
236template<
typename TOperation>
237[[
nodiscard]] std::pair<SimpleNode *, const TOperation *>
243 return std::make_pair(
nullptr,
nullptr);
273template<
typename TOperation>
274[[
nodiscard]] std::pair<const SimpleNode *, const TOperation *>
280 return std::make_pair(
nullptr,
nullptr);
NodeInput * input(size_t index) const noexcept
NodeOutput * output(size_t index) const noexcept
rvsdg::Region * region() const noexcept
Represent acyclic RVSDG subgraphs.
static SimpleNode & Create(Region ®ion, std::unique_ptr< Operation > operation, const std::vector< rvsdg::Output * > &operands)
const SimpleOperation & GetOperation() const noexcept override
std::unique_ptr< SimpleOperation > Operation_
Node * copy(Region *region, const std::vector< Output * > &operands) const override
std::string DebugString() const override
NodeInput * input(size_t index) const noexcept
NodeOutput * output(size_t index) const noexcept
std::pair< SimpleNode *, const TOperation * > TryGetSimpleNodeAndOptionalOp(const Input &input) noexcept
Checks if this is an input to a SimpleNode and of specified operation type.
static std::vector< jlm::rvsdg::Output * > operands(const Node *node)
std::optional< std::vector< rvsdg::Output * > > NormalizeSimpleOperationCommonNodeElimination(Region ®ion, const SimpleOperation &operation, const std::vector< rvsdg::Output * > &operands)
Performs common node elimination for a given operation and operands in a region.
SimpleNode & CreateOpNode(const std::vector< Output * > &operands, OperatorArguments... operatorArguments)
Creates a simple node characterized by its operator.
NodeType * TryGetOwnerNode(const rvsdg::Input &input) noexcept
Checks if this is an input to a node of specified type.