6 #ifndef JLM_RVSDG_DELTA_HPP
7 #define JLM_RVSDG_DELTA_HPP
23 std::shared_ptr<const rvsdg::
Type>
type,
25 std::shared_ptr<const rvsdg::
Type> reftype)
41 [[nodiscard]] std::string
44 [[nodiscard]] std::unique_ptr<Operation>
45 copy()
const override;
62 [[nodiscard]]
const std::shared_ptr<const rvsdg::Type> &
68 [[nodiscard]]
const std::shared_ptr<const rvsdg::Type> &
92 static inline std::unique_ptr<DeltaOperation>
94 std::shared_ptr<const rvsdg::Type>
type,
96 std::shared_ptr<const rvsdg::Type> reftype)
98 return std::make_unique<DeltaOperation>(std::move(
type),
constant, std::move(reftype));
103 std::shared_ptr<const rvsdg::Type>
type_;
230 [[nodiscard]] std::vector<ContextVar>
242 [[nodiscard]] const std::shared_ptr<const rvsdg::
Type> &
290 [[nodiscard]] rvsdg::
Input &
315 return new DeltaNode(parent, std::move(op));
343 argumentIndices.
insert(argument->index());
350 [[maybe_unused]]
const auto numRemovedInputs =
RemoveInputs(inputIndices);
353 return numRemovedInputs;
ContextVar MapInputContextVar(const rvsdg::Input &input) const noexcept
Maps input to context variable.
rvsdg::Input & result() const noexcept
std::vector< ContextVar > GetContextVars() const noexcept
Gets all bound context variables.
DeltaNode(rvsdg::Region *parent, std::unique_ptr< DeltaOperation > op)
ContextVar MapBinderContextVar(const rvsdg::Output &output) const noexcept
Maps bound variable reference to context variable.
~DeltaNode() noexcept override
rvsdg::Region * subregion() const noexcept
size_t RemoveDeltaInputsWhere(const F &match)
ContextVar AddContextVar(jlm::rvsdg::Output &origin)
Adds a context/free variable to the delta node.
const DeltaOperation & GetOperation() const noexcept override
std::unique_ptr< DeltaOperation > Operation_
static DeltaNode * Create(rvsdg::Region *parent, std::unique_ptr< DeltaOperation > op)
size_t PruneDeltaInputs()
bool constant() const noexcept
rvsdg::Output & finalize(rvsdg::Output *result)
rvsdg::Output & output() const noexcept
DeltaNode * copy(rvsdg::Region *region, const std::vector< jlm::rvsdg::Output * > &operands) const override
DeltaOperation & operator=(DeltaOperation &&)=delete
~DeltaOperation() noexcept override
std::string debug_string() const override
DeltaOperation(const DeltaOperation &other)=default
const rvsdg::Type & type() const noexcept
static std::unique_ptr< DeltaOperation > Create(std::shared_ptr< const rvsdg::Type > type, bool constant, std::shared_ptr< const rvsdg::Type > reftype)
Creates parameterized delta operation.
DeltaOperation & operator=(const DeltaOperation &)=delete
std::shared_ptr< const rvsdg::Type > reftype_
DeltaOperation(DeltaOperation &&other) noexcept=default
bool constant() const noexcept
const std::shared_ptr< const rvsdg::Type > & Type() const noexcept
const std::shared_ptr< const rvsdg::Type > & ReferenceType() const noexcept
std::shared_ptr< const rvsdg::Type > type_
bool operator==(const Operation &other) const noexcept override
std::unique_ptr< Operation > copy() const override
rvsdg::Region * region() const noexcept
size_t RemoveInputs(const util::HashSet< size_t > &indices)
Represent acyclic RVSDG subgraphs.
size_t RemoveArguments(const util::HashSet< size_t > &indices)
StructuralInput * input(size_t index) const noexcept
rvsdg::Region * subregion(size_t index) const noexcept
bool insert(ItemType item)
std::size_t Size() const noexcept
jlm::rvsdg::Output * match(size_t nbits, const std::unordered_map< uint64_t, uint64_t > &mapping, uint64_t default_alternative, size_t nalternatives, jlm::rvsdg::Output *operand)
static std::vector< jlm::rvsdg::Output * > operands(const Node *node)
rvsdg::Input * input
Input variable bound into delta node.
rvsdg::Output * inner
Access to bound object in subregion.