7 #ifndef JLM_RVSDG_PHI_HPP
8 #define JLM_RVSDG_PHI_HPP
25 [[nodiscard]] std::string
28 [[nodiscard]] std::unique_ptr<Operation>
29 copy()
const override;
240 [[nodiscard]] std::vector<
FixVar>
262 [[nodiscard]] std::optional<
FixVar>
336 static std::vector<rvsdg::LambdaNode *>
rvsdg::Region * region() const noexcept
constexpr PhiBuilder() noexcept
rvsdg::Region * subregion() const noexcept
PhiNode::ContextVar AddContextVar(jlm::rvsdg::Output &origin)
PhiNode::FixVar AddFixVar(std::shared_ptr< const jlm::rvsdg::Type > type)
void begin(rvsdg::Region *parent)
A phi node represents the fixpoint of mutually recursive definitions.
PhiNode(rvsdg::Region *parent)
rvsdg::Region * subregion() const noexcept
FixVar MapResultFixVar(const rvsdg::Input &result) const noexcept
Maps region result to fixpoint variable.
PhiNode * copy(rvsdg::Region *region, rvsdg::SubstitutionMap &smap) const override
Copy a node with substitutions.
ContextVar MapInputContextVar(const rvsdg::Input &input) const noexcept
Maps input to context variable.
std::optional< ContextVar > MapArgumentContextVar(const rvsdg::Output &argument) const noexcept
Attempts to map bound variable reference to context variable.
static std::vector< rvsdg::LambdaNode * > ExtractLambdaNodes(const PhiNode &phiNode)
std::vector< FixVar > GetFixVars() const noexcept
Gets all fixpoint variables.
void RemoveContextVars(std::vector< ContextVar > vars)
Removes context variables from phi node.
static PhiNode * create(rvsdg::Region *parent)
FixVar MapOutputFixVar(const rvsdg::Output &output) const noexcept
Maps output to fixpoint variable.
std::vector< ContextVar > GetContextVars() const noexcept
Gets all bound context variables.
std::optional< FixVar > MapArgumentFixVar(const rvsdg::Output &argument) const noexcept
Tries to map region argument to fixpoint variable.
std::variant< FixVar, ContextVar > MapArgument(const rvsdg::Output &argument) const noexcept
Maps region argument to its function.
ContextVar AddContextVar(jlm::rvsdg::Output &origin)
Adds a context variable to the phi node.
void RemoveFixVars(std::vector< FixVar > vars)
Removes fixpoint variables from the phi node.
const PhiOperation & GetOperation() const noexcept override
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
Represent acyclic RVSDG subgraphs.
StructuralOutput * output(size_t index) const noexcept
StructuralInput * input(size_t index) const noexcept
rvsdg::Region * subregion(size_t index) const noexcept
static std::string type(const Node *n)
rvsdg::Input * input
Input variable bound into the phi construct.
rvsdg::Output * inner
Access to bound object in subregion.
Description of a recursively defined variable.
rvsdg::Output * recref
Reference to mutual-recursively defined object in phi.
rvsdg::Input * result
Definition result of a variable within the phi region.
rvsdg::Output * output
Output of phi region representing externally available definition.