19 addInput(std::make_unique<StructuralInput>(
this, &origin, origin.Type()),
true);
27 JLM_ASSERT(rvsdg::TryGetOwnerNode<DeltaNode>(input) ==
this);
38 std::vector<DeltaNode::ContextVar>
41 std::vector<ContextVar> vars;
42 for (
size_t n = 0; n <
ninputs(); ++n)
55 std::unique_ptr<rvsdg::Operation>
58 return std::make_unique<DeltaOperation>(*
this);
65 return op && op->
constant_ == constant_ && *op->type_ == *type_;
93 auto origin = &smap.
lookup(*cv.input->origin());
94 auto newCtxVar = delta->AddContextVar(*origin);
95 subregionmap.
insert(cv.inner, newCtxVar.inner);
102 auto result = &subregionmap.
lookup(*delta->result().origin());
103 auto o = &delta->finalize(
result);
131 auto & expected =
Type();
132 auto & received = *origin->
Type();
133 if (*expected != received)
134 throw util::Error(
"Expected " + expected->debug_string() +
", got " + received.debug_string());
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.
ContextVar MapBinderContextVar(const rvsdg::Output &output) const noexcept
Maps bound variable reference to context variable.
~DeltaNode() noexcept override
rvsdg::Region * subregion() const noexcept
std::unique_ptr< DeltaOperation > Operation_
static DeltaNode * Create(rvsdg::Region *parent, std::unique_ptr< DeltaOperation > op)
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
const std::shared_ptr< const rvsdg::Type > & Type() const noexcept
~DeltaOperation() noexcept override
std::string debug_string() const override
bool operator==(const Operation &other) const noexcept override
std::unique_ptr< Operation > copy() const override
rvsdg::Region * region() const noexcept
size_t ninputs() const noexcept
size_t noutputs() const noexcept
virtual Node * copy(rvsdg::Region *region, const std::vector< jlm::rvsdg::Output * > &operands) const
rvsdg::Region * region() const noexcept
const std::shared_ptr< const rvsdg::Type > & Type() const noexcept
static RegionArgument & Create(rvsdg::Region ®ion, StructuralInput *input, std::shared_ptr< const rvsdg::Type > type)
Creates region entry argument.
static RegionResult & Create(rvsdg::Region ®ion, rvsdg::Output &origin, StructuralOutput *output, std::shared_ptr< const rvsdg::Type > type)
Create region exit result.
Represent acyclic RVSDG subgraphs.
RegionResult * result(size_t index) const noexcept
void copy(Region *target, SubstitutionMap &smap) const
Copy a region with substitutions.
RegionArgument * argument(size_t index) const noexcept
StructuralOutput * addOutput(std::unique_ptr< StructuralOutput > input)
StructuralOutput * output(size_t index) const noexcept
StructuralInput * input(size_t index) const noexcept
void insert(const Output *original, Output *substitute)
Output & lookup(const Output &original) const
static std::vector< jlm::rvsdg::Output * > operands(const Node *node)
Region * TryGetOwnerRegion(const rvsdg::Input &input) noexcept
static std::string strfmt(Args... args)