15 ForkOperation::~ForkOperation() noexcept = default;
17 MuxOperation::~MuxOperation() noexcept = default;
19 SinkOperation::~SinkOperation() noexcept = default;
21 PredicateBufferOperation::~PredicateBufferOperation() noexcept = default;
23 LoopConstantBufferOperation::~LoopConstantBufferOperation() noexcept = default;
25 BundleType::~BundleType() noexcept = default;
27 LoopOperation::~LoopOperation() noexcept = default;
29 PrintOperation::~PrintOperation() noexcept = default;
31 BufferOperation::~BufferOperation() noexcept = default;
33 TriggerOperation::~TriggerOperation() noexcept = default;
35 TriggerType::~TriggerType() noexcept = default;
37 StateGateOperation::~StateGateOperation() noexcept = default;
39 LoadOperation::~LoadOperation() noexcept = default;
41 DecoupledLoadOperation::~DecoupledLoadOperation() noexcept = default;
43 AddressQueueOperation::~AddressQueueOperation() noexcept = default;
45 MemoryResponseOperation::~MemoryResponseOperation() noexcept = default;
47 LocalLoadOperation::~LocalLoadOperation() noexcept = default;
49 LocalMemoryOperation::~LocalMemoryOperation() noexcept = default;
51 LocalMemoryRequestOperation::~LocalMemoryRequestOperation() noexcept = default;
53 LocalMemoryResponseOperation::~LocalMemoryResponseOperation() noexcept = default;
55 LocalStoreOperation::~LocalStoreOperation() noexcept = default;
57 StoreOperation::~StoreOperation() noexcept = default;
71 std::shared_ptr<const TriggerType>
75 return std::shared_ptr<const TriggerType>(std::shared_ptr<void>(), &instance);
81 std::size_t seed =
typeid(
BundleType).hash_code();
84 auto firstHash = std::hash<std::string>()(element.first);
102 return Create(region, *input,
Type());
138 addInput(std::make_unique<rvsdg::StructuralInput>(
this, origin, origin->
Type()),
true);
143 auto backedge_result = backedge_argument->result();
148 { &argument_in, backedge_argument },
152 if (buffer !=
nullptr)
160 const auto output =
addOutput(std::make_unique<rvsdg::StructuralOutput>(
this, origin->
Type()));
165 backedge_result->divert_to(buf);
173 addInput(std::make_unique<rvsdg::StructuralInput>(
this, origin, origin->
Type()),
true);
184 addInput(std::make_unique<rvsdg::StructuralInput>(
this, origin, origin->
Type()),
true);
191 const auto output =
addOutput(std::make_unique<rvsdg::StructuralOutput>(
this, origin->
Type()));
232 for (
size_t i = 0; i <
ninputs(); ++i)
235 auto inp = loop->addInput(
236 std::make_unique<rvsdg::StructuralInput>(loop, in_origin, in_origin->Type()),
243 for (
size_t i = 0; i <
noutputs(); ++i)
245 auto out = loop->addOutput(std::make_unique<rvsdg::StructuralOutput>(loop,
output(i)->
Type()));
255 auto na = loop->add_backedge(arg->Type());
272 for (
size_t i = 0; i <
noutputs(); ++i)
275 auto res = outp->results.begin().ptr();
276 auto origin = &smap.
lookup(*res->origin());
288 argument_loop.result_ = &result_loop;
289 result_loop.argument_ = &argument_loop;
290 return &argument_loop;
301 pred_arg->result()->divert_to(
predicate);
313 auto node = rvsdg::TryGetOwnerNode<Node>(*
predicate()->origin());
315 if (node && node->IsDead())
319 std::shared_ptr<const BundleType>
322 std::vector<std::pair<std::string, std::shared_ptr<const jlm::rvsdg::Type>>> elements;
328 elements.emplace_back(
"data", std::move(elementType));
331 return std::make_shared<BundleType>(std::move(elements));
334 std::shared_ptr<const BundleType>
337 std::vector<std::pair<std::string, std::shared_ptr<const jlm::rvsdg::Type>>> elements;
338 elements.emplace_back(
"data", std::move(dataType));
340 return std::make_shared<BundleType>(std::move(elements));
352 return JlmSize(&at->element_type()) * at->nelements();
356 return JlmSize(&vt->type()) * vt->size();
364 return ceil(log2(ct->nalternatives()));
370 else if (rvsdg::is<BundleType>(*
type))
386 throw std::logic_error(
"Size of '" +
type->debug_string() +
"' is not implemented!");
391 throw std::logic_error(
"Size of '" +
type->debug_string() +
"' is not implemented!");
static BackEdgeArgument & create(rvsdg::Region *region, std::shared_ptr< const jlm::rvsdg::Type > type)
BackEdgeResult * result()
BackEdgeArgument & Copy(rvsdg::Region ®ion, rvsdg::StructuralInput *input) const override
BackEdgeResult & Copy(rvsdg::Output &origin, rvsdg::StructuralOutput *output) const override
static BackEdgeResult & create(jlm::rvsdg::Output *origin)
~BranchOperation() noexcept override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &predicate, jlm::rvsdg::Output &value, bool loop=false)
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &value, size_t capacity, bool pass_through=false)
rvsdg::TypeKind Kind() const noexcept override
Return the kind of this type.
const std::vector< std::pair< std::string, std::shared_ptr< const jlm::rvsdg::Type > > > elements_
std::size_t ComputeHash() const noexcept override
BundleType(const std::vector< std::pair< std::string, std::shared_ptr< const Type >>> elements)
~EntryArgument() noexcept override
static EntryArgument & Create(rvsdg::Region ®ion, rvsdg::StructuralInput &input, const std::shared_ptr< const rvsdg::Type > type)
ExitResult & Copy(rvsdg::Output &origin, rvsdg::StructuralOutput *output) const override
~ExitResult() noexcept override
static ExitResult & Create(rvsdg::Output &origin, rvsdg::StructuralOutput &output)
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &predicate, jlm::rvsdg::Output &value)
LoopNode * copy(rvsdg::Region *region, rvsdg::SubstitutionMap &smap) const override
Copy a node with substitutions.
LoopNode(rvsdg::Region *parent)
rvsdg::Region * subregion() const noexcept
rvsdg::Output * addRequestOutput(rvsdg::Output *origin)
void removeLoopOutput(rvsdg::StructuralOutput *output)
static LoopNode * create(rvsdg::Region *parent, bool init=true)
rvsdg::Output * PredicateBuffer_
rvsdg::StructuralOutput * AddLoopVar(rvsdg::Output *origin, rvsdg::Output **buffer=nullptr)
rvsdg::Output & GetPredicateBuffer() const noexcept
const rvsdg::Operation & GetOperation() const noexcept override
void set_predicate(jlm::rvsdg::Output *p)
rvsdg::Output * addLoopConstant(rvsdg::Output *origin)
rvsdg::Output * addResponseInput(rvsdg::Output *origin)
rvsdg::RegionResult * predicate() const noexcept
BackEdgeArgument * add_backedge(std::shared_ptr< const jlm::rvsdg::Type > type)
void removeLoopInput(rvsdg::StructuralInput *input)
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &predicate, const std::vector< jlm::rvsdg::Output * > &alternatives, bool discarding, bool loop=false)
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &predicate)
rvsdg::TypeKind Kind() const noexcept override
Return the kind of this type.
static std::shared_ptr< const TriggerType > Create()
static std::shared_ptr< const PointerType > Create()
static std::shared_ptr< const BitType > Create(std::size_t nbits)
Creates bit type of specified width.
static Output & createFalse(Region ®ion)
static std::shared_ptr< const ControlType > Create(std::size_t nalternatives)
Instantiates control type.
rvsdg::Region * region() const noexcept
size_t RemoveInputs(const util::HashSet< size_t > &indices)
size_t ninputs() const noexcept
size_t noutputs() const noexcept
size_t RemoveOutputs(const util::HashSet< size_t > &indices)
rvsdg::Region * region() const noexcept
const std::shared_ptr< const rvsdg::Type > & Type() const noexcept
size_t index() const noexcept
void divert_users(jlm::rvsdg::Output *new_origin)
bool IsDead() const noexcept
StructuralInput * input() const noexcept
Represents the result of a region.
StructuralOutput * output() const noexcept
Represent acyclic RVSDG subgraphs.
size_t RemoveResults(const util::HashSet< size_t > &indices)
void copy(Region *target, SubstitutionMap &smap) const
Copy a region with substitutions.
RegionArgument * argument(size_t index) const noexcept
size_t RemoveArguments(const util::HashSet< size_t > &indices)
size_t narguments() const noexcept
StructuralInput * addInput(std::unique_ptr< StructuralInput > input, bool notifyRegion)
StructuralOutput * addOutput(std::unique_ptr< StructuralOutput > input)
StructuralOutput * output(size_t index) const noexcept
StructuralInput * input(size_t index) const noexcept
StructuralNode * node() const noexcept
void insert(const Output *original, Output *substitute)
Output & lookup(const Output &original) const
size_type size() const noexcept
Iterator begin() noexcept
std::shared_ptr< const BundleType > get_mem_res_type(std::shared_ptr< const jlm::rvsdg::Type > dataType)
std::shared_ptr< const BundleType > get_mem_req_type(std::shared_ptr< const rvsdg::Type > elementType, bool write)
int JlmSize(const jlm::rvsdg::Type *type)
size_t GetPointerSizeInBits()
static void remove(Node *node)
static std::string type(const Node *n)
TypeKind
The kinds of types supported in rvsdg.
@ State
Designate a state type.
@ Value
Designate a value type.
void combineHashesWithSeed(std::size_t &seed, std::size_t hash, Args... args)