6 #ifndef JLM_LLVM_IR_OPERATORS_ALLOCA_HPP
7 #define JLM_LLVM_IR_OPERATORS_ALLOCA_HPP
23 std::shared_ptr<const rvsdg::Type> allocatedType,
24 std::shared_ptr<const rvsdg::BitType> btype,
36 operator==(
const Operation & other)
const noexcept
override;
38 [[nodiscard]] std::string
41 [[nodiscard]] std::unique_ptr<Operation>
42 copy()
const override;
47 return *std::static_pointer_cast<const rvsdg::BitType>(
argument(0));
56 [[nodiscard]]
const std::shared_ptr<const rvsdg::Type> &
72 return *node.
input(0);
89 static std::unique_ptr<llvm::ThreeAddressCode>
92 auto bt = std::dynamic_pointer_cast<const rvsdg::BitType>(size->
Type());
96 auto op = std::make_unique<AllocaOperation>(std::move(allocatedType), std::move(bt),
alignment);
107 static std::vector<rvsdg::Output *>
110 auto bt = std::dynamic_pointer_cast<const rvsdg::BitType>(size->
Type());
114 return outputs(&rvsdg::CreateOpNode<AllocaOperation>(
116 std::move(allocatedType),
static rvsdg::Input & getCountInput(rvsdg::Node &node)
AllocaOperation(AllocaOperation &&other) noexcept=default
bool operator==(const Operation &other) const noexcept override
std::string debug_string() const override
std::shared_ptr< const rvsdg::Type > AllocatedType_
~AllocaOperation() noexcept override
static std::unique_ptr< llvm::ThreeAddressCode > create(std::shared_ptr< const rvsdg::Type > allocatedType, const Variable *size, size_t alignment)
static std::vector< rvsdg::Output * > create(std::shared_ptr< const rvsdg::Type > allocatedType, rvsdg::Output *size, size_t alignment)
const rvsdg::BitType & size_type() const noexcept
static rvsdg::Output & getMemoryStateOutput(rvsdg::Node &node)
const std::shared_ptr< const rvsdg::Type > & ValueType() const noexcept
size_t alignment() const noexcept
static rvsdg::Output & getPointerOutput(rvsdg::Node &node)
AllocaOperation(const AllocaOperation &other)=default
const rvsdg::Type & value_type() const noexcept
std::unique_ptr< Operation > copy() const override
static std::shared_ptr< const MemoryStateType > Create()
static std::shared_ptr< const PointerType > Create()
static std::unique_ptr< llvm::ThreeAddressCode > create(std::unique_ptr< rvsdg::SimpleOperation > operation, const std::vector< const Variable * > &operands)
const std::shared_ptr< const jlm::rvsdg::Type > Type() const noexcept
NodeInput * input(size_t index) const noexcept
NodeOutput * output(size_t index) const noexcept
const std::shared_ptr< const rvsdg::Type > & Type() const noexcept
const std::shared_ptr< const rvsdg::Type > & argument(size_t index) const noexcept
SimpleOperation(std::vector< std::shared_ptr< const jlm::rvsdg::Type >> operands, std::vector< std::shared_ptr< const jlm::rvsdg::Type >> results)
Global memory state passed between functions.
static std::vector< jlm::rvsdg::Output * > outputs(const Node *node)