16 std::shared_ptr<const rvsdg::FunctionType> fn)
18 FunctionType_(std::move(fn))
26 return *FunctionType() == *o->FunctionType();
34 [[nodiscard]] std::string
40 [[nodiscard]] std::unique_ptr<rvsdg::Operation>
49 if (
auto node = rvsdg::TryGetOwnerNode<rvsdg::SimpleNode>(*arg))
53 if (*op->FunctionType() == *FunctionType())
67 if (
auto node = rvsdg::TryGetOwnerNode<rvsdg::SimpleNode>(*arg))
73 return node->input(0)->origin();
80 std::unique_ptr<FunctionToPointerOperation>
83 return std::make_unique<FunctionToPointerOperation>(std::move(fn));
90 std::shared_ptr<const rvsdg::FunctionType> fn)
92 FunctionType_(std::move(fn))
100 return *FunctionType() == *o->FunctionType();
108 [[nodiscard]] std::string
111 return "PtrFun(" +
FunctionType()->debug_string() +
")";
114 [[nodiscard]] std::unique_ptr<rvsdg::Operation>
123 if (
auto node = rvsdg::TryGetOwnerNode<rvsdg::SimpleNode>(*arg))
127 if (*op->FunctionType() == *FunctionType())
141 if (
auto node = rvsdg::TryGetOwnerNode<rvsdg::SimpleNode>(*arg))
147 return node->input(0)->origin();
154 std::unique_ptr<PointerToFunctionOperation>
157 return std::make_unique<PointerToFunctionOperation>(std::move(fn));
Get address of compiled function object.
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
bool operator==(const Operation &other) const noexcept override
static std::unique_ptr< FunctionToPointerOperation > Create(std::shared_ptr< const rvsdg::FunctionType > fn)
FunctionToPointerOperation(std::shared_ptr< const rvsdg::FunctionType > fn)
~FunctionToPointerOperation() noexcept override
rvsdg::unop_reduction_path_t can_reduce_operand(const jlm::rvsdg::Output *arg) const noexcept override
jlm::rvsdg::Output * reduce_operand(rvsdg::unop_reduction_path_t path, jlm::rvsdg::Output *arg) const override
const std::shared_ptr< const jlm::rvsdg::FunctionType > & FunctionType() const noexcept
Interpret pointer as callable function.
std::string debug_string() const override
PointerToFunctionOperation(std::shared_ptr< const rvsdg::FunctionType > fn)
std::unique_ptr< rvsdg::Operation > copy() const override
const std::shared_ptr< const rvsdg::FunctionType > & FunctionType() const noexcept
bool operator==(const Operation &other) const noexcept override
jlm::rvsdg::Output * reduce_operand(rvsdg::unop_reduction_path_t path, jlm::rvsdg::Output *arg) const override
rvsdg::unop_reduction_path_t can_reduce_operand(const jlm::rvsdg::Output *arg) const noexcept override
~PointerToFunctionOperation() noexcept override
static std::unique_ptr< PointerToFunctionOperation > Create(std::shared_ptr< const rvsdg::FunctionType > fn)
Global memory state passed between functions.
size_t unop_reduction_path_t
static const unop_reduction_path_t unop_reduction_inverse
static const unop_reduction_path_t unop_reduction_none