6#ifndef JLM_LLVM_IR_OPERATORS_CONVERSIONOPERATIONS_HPP
7#define JLM_LLVM_IR_OPERATORS_CONVERSIONOPERATIONS_HPP
24 std::shared_ptr<const
jlm::rvsdg::Type> srctype,
25 std::shared_ptr<const
jlm::rvsdg::Type> dsttype)
42 operator==(
const Operation & other)
const noexcept override;
44 [[nodiscard]] std::string
47 [[nodiscard]] std::unique_ptr<Operation>
48 copy()
const override;
50 static std::unique_ptr<llvm::ThreeAddressCode>
55 auto op = std::make_unique<BitCastOperation>(pair.first, pair.second);
67 static std::pair<std::shared_ptr<const jlm::rvsdg::Type>, std::shared_ptr<const jlm::rvsdg::Type>>
69 const std::shared_ptr<const jlm::rvsdg::Type> & otype,
70 const std::shared_ptr<const jlm::rvsdg::Type> & rtype)
78 return std::make_pair(otype, rtype);
88 std::shared_ptr<const rvsdg::Type> srctype,
89 std::shared_ptr<const rvsdg::Type> dsttype)
92 auto ot = std::dynamic_pointer_cast<const rvsdg::BitType>(srctype);
96 auto rt = std::dynamic_pointer_cast<const rvsdg::BitType>(dsttype);
100 if (ot->nbits() >= rt->nbits())
101 throw util::Error(
"expected operand's #bits to be smaller than results' #bits.");
105 operator==(
const Operation & other)
const noexcept override;
107 [[nodiscard]] std::string
110 [[nodiscard]] std::unique_ptr<Operation>
111 copy()
const override;
116 return std::static_pointer_cast<const rvsdg::BitType>(
argument(0))->nbits();
122 return std::static_pointer_cast<const rvsdg::BitType>(
result(0))->nbits();
125 static std::unique_ptr<llvm::ThreeAddressCode>
128 auto operation = std::make_unique<SExtOperation>(operand->
Type(), std::move(type));
157 static std::optional<std::vector<rvsdg::Output *>>
167 std::shared_ptr<const
jlm::rvsdg::Type> srctype,
168 std::shared_ptr<const
jlm::rvsdg::Type> dsttype)
179 if (dt->nbits() < st->nbits())
180 throw util::Error(
"# destination bits must be greater than # source bits.");
184 operator==(
const Operation & other)
const noexcept override;
186 [[nodiscard]] std::string
189 [[nodiscard]] std::unique_ptr<Operation>
190 copy()
const override;
195 return std::static_pointer_cast<const rvsdg::BitType>(
argument(0))->nbits();
201 return std::static_pointer_cast<const rvsdg::BitType>(
result(0))->nbits();
204 static std::unique_ptr<llvm::ThreeAddressCode>
207 auto operation = std::make_unique<ZExtOperation>(operand->
Type(), std::move(type));
236 static std::optional<std::vector<rvsdg::Output *>>
246 const std::shared_ptr<const rvsdg::BitType> & operandType,
247 const std::shared_ptr<const rvsdg::BitType> & resultType)
250 if (operandType->nbits() < resultType->nbits())
251 throw util::Error(
"expected operand's #bits to be larger than results' #bits.");
255 std::shared_ptr<const rvsdg::Type> operandType,
256 std::shared_ptr<const rvsdg::Type> resultType)
261 operator==(
const Operation & other)
const noexcept override;
263 [[nodiscard]] std::string
266 [[nodiscard]] std::unique_ptr<Operation>
267 copy()
const override;
272 return std::static_pointer_cast<const rvsdg::BitType>(
argument(0))->nbits();
278 return std::static_pointer_cast<const rvsdg::BitType>(
result(0))->nbits();
281 static std::unique_ptr<ThreeAddressCode>
284 auto truncOperation = std::make_unique<TruncOperation>(operand->
Type(), resultType);
310 static std::optional<std::vector<rvsdg::Output *>>
314 static std::shared_ptr<const rvsdg::BitType>
317 if (
auto bitType = std::dynamic_pointer_cast<const rvsdg::BitType>(type))
322 throw std::logic_error(
"expected bits type.");
333 std::shared_ptr<const
jlm::rvsdg::BitType> btype)
338 std::shared_ptr<const jlm::rvsdg::Type> srctype,
339 std::shared_ptr<const jlm::rvsdg::Type> dsttype)
342 auto pt =
dynamic_cast<const PointerType *
>(srctype.get());
352 operator==(
const Operation & other)
const noexcept override;
354 [[nodiscard]] std::string
357 [[nodiscard]] std::unique_ptr<Operation>
358 copy()
const override;
363 return std::static_pointer_cast<const rvsdg::BitType>(
result(0))->nbits();
366 static std::unique_ptr<llvm::ThreeAddressCode>
369 auto pt = std::dynamic_pointer_cast<const PointerType>(
argument->Type());
373 auto bt = std::dynamic_pointer_cast<const jlm::rvsdg::BitType>(type);
377 auto op = std::make_unique<PtrToIntOperation>(std::move(pt), std::move(bt));
391 throw util::Error(
"destination type size must be bigger than source type size.");
395 const std::shared_ptr<const FloatingPointType> & operandType,
396 const std::shared_ptr<const FloatingPointType> & resultType)
400 throw util::Error(
"destination type size must be bigger than source type size.");
404 const std::shared_ptr<const rvsdg::Type> & operandType,
405 const std::shared_ptr<const rvsdg::Type> & resultType)
412 throw util::Error(
"destination type size must be bigger than source type size.");
416 operator==(
const Operation & other)
const noexcept override;
418 [[nodiscard]] std::string
421 [[nodiscard]] std::unique_ptr<Operation>
422 copy()
const override;
427 return std::static_pointer_cast<const FloatingPointType>(
argument(0))->size();
433 return std::static_pointer_cast<const FloatingPointType>(
result(0))->size();
436 static std::unique_ptr<llvm::ThreeAddressCode>
437 create(
const Variable * operand,
const std::shared_ptr<const rvsdg::Type> & resultType)
439 auto op = std::make_unique<FPExtOperation>(operand->
Type(), resultType);
459 static std::optional<std::vector<rvsdg::Output *>>
469 throw util::Error(
"Expected floating point type.");
483 throw util::Error(
"destination tpye size must be smaller than source size type.");
487 const std::shared_ptr<const FloatingPointType> & srctype,
488 const std::shared_ptr<const FloatingPointType> & dsttype)
492 throw util::Error(
"destination type size must be bigger than source type size.");
496 const std::shared_ptr<const rvsdg::Type> & operandType,
497 const std::shared_ptr<const rvsdg::Type> & resultType)
506 throw util::Error(
"destination type size must be smaller than source size type.");
510 operator==(
const Operation & other)
const noexcept override;
512 [[nodiscard]] std::string
515 [[nodiscard]] std::unique_ptr<Operation>
516 copy()
const override;
521 return std::static_pointer_cast<const FloatingPointType>(
argument(0))->size();
527 return std::static_pointer_cast<const FloatingPointType>(
result(0))->size();
530 static std::unique_ptr<llvm::ThreeAddressCode>
531 create(
const Variable * operand, std::shared_ptr<const jlm::rvsdg::Type> resultType)
533 auto op = std::make_unique<FPTruncOperation>(operand->
Type(), resultType);
553 static std::optional<std::vector<rvsdg::Output *>>
563 throw util::Error(
"Expected floating point type.");
573 std::shared_ptr<const
jlm::rvsdg::BitType> srctype,
579 std::shared_ptr<const jlm::rvsdg::Type> optype,
580 std::shared_ptr<const jlm::rvsdg::Type> restype)
589 throw util::Error(
"expected floating point type.");
593 operator==(
const Operation & other)
const noexcept override;
595 [[nodiscard]] std::string
598 [[nodiscard]] std::unique_ptr<Operation>
599 copy()
const override;
601 static std::unique_ptr<llvm::ThreeAddressCode>
602 create(
const Variable * operand,
const std::shared_ptr<const jlm::rvsdg::Type> & type)
604 auto st = std::dynamic_pointer_cast<const jlm::rvsdg::BitType>(operand->
Type());
608 auto rt = std::dynamic_pointer_cast<const FloatingPointType>(type);
610 throw util::Error(
"expected floating point type.");
612 auto op = std::make_unique<UIToFPOperation>(std::move(st), std::move(rt));
623 std::shared_ptr<const
jlm::rvsdg::BitType> srctype,
629 std::shared_ptr<const jlm::rvsdg::Type> srctype,
630 std::shared_ptr<const jlm::rvsdg::Type> dsttype)
639 throw util::Error(
"expected floating point type.");
643 operator==(
const Operation & other)
const noexcept override;
645 [[nodiscard]] std::string
648 [[nodiscard]] std::unique_ptr<Operation>
649 copy()
const override;
651 static std::unique_ptr<llvm::ThreeAddressCode>
652 create(
const Variable * operand,
const std::shared_ptr<const jlm::rvsdg::Type> & type)
654 auto st = std::dynamic_pointer_cast<const jlm::rvsdg::BitType>(operand->
Type());
658 auto rt = std::dynamic_pointer_cast<const FloatingPointType>(type);
660 throw util::Error(
"expected floating point type.");
662 auto op = std::make_unique<SIToFPOperation>(std::move(st), std::move(rt));
675 std::shared_ptr<const rvsdg::BitType> operandType,
683 const std::shared_ptr<const rvsdg::Type> & operandType,
684 const std::shared_ptr<const rvsdg::Type> &)
691 operator==(
const Operation & other)
const noexcept override;
693 [[nodiscard]] std::string
696 [[nodiscard]] std::unique_ptr<Operation>
697 copy()
const override;
702 return std::static_pointer_cast<const rvsdg::BitType>(
argument(0))->nbits();
705 static std::unique_ptr<ThreeAddressCode>
722 static std::shared_ptr<const rvsdg::BitType>
725 if (
auto bitType = std::dynamic_pointer_cast<const rvsdg::BitType>(operandType))
730 throw std::logic_error(
"expected bitstring type.");
744 std::shared_ptr<const FloatingPointType> operandType,
745 std::shared_ptr<const rvsdg::BitType> resultType)
750 const std::shared_ptr<const rvsdg::Type> & operandType,
751 const std::shared_ptr<const rvsdg::Type> & resultType)
759 operator==(
const Operation & other)
const noexcept override;
761 [[nodiscard]] std::string
764 [[nodiscard]] std::unique_ptr<Operation>
765 copy()
const override;
767 static std::unique_ptr<ThreeAddressCode>
768 create(
const Variable * operand,
const std::shared_ptr<const rvsdg::Type> & type)
772 auto operation = std::make_unique<FPToUIOperation>(std::move(operandType), std::move(bitType));
777 static std::shared_ptr<const FloatingPointType>
780 if (
auto fpType = std::dynamic_pointer_cast<const FloatingPointType>(operandType))
785 throw std::logic_error(
"Expected floating point type.");
788 static std::shared_ptr<const rvsdg::BitType>
791 if (
auto bitType = std::dynamic_pointer_cast<const rvsdg::BitType>(resultType))
796 throw std::logic_error(
"Expected bitstring type.");
810 std::shared_ptr<const FloatingPointType> operandType,
811 std::shared_ptr<const rvsdg::BitType> resultType)
816 const std::shared_ptr<const rvsdg::Type> & operandType,
817 const std::shared_ptr<const rvsdg::Type> & resultType)
825 operator==(
const Operation & other)
const noexcept override;
827 [[nodiscard]] std::string
830 [[nodiscard]] std::unique_ptr<Operation>
831 copy()
const override;
833 static std::unique_ptr<ThreeAddressCode>
834 create(
const Variable * operand,
const std::shared_ptr<const rvsdg::Type> & type)
838 auto op = std::make_unique<FPToSIOperation>(std::move(operandType), std::move(bitType));
843 static std::shared_ptr<const FloatingPointType>
846 if (
auto fpType = std::dynamic_pointer_cast<const FloatingPointType>(operandType))
851 throw std::logic_error(
"Expected floating point type.");
854 static std::shared_ptr<const rvsdg::BitType>
857 if (
auto bitType = std::dynamic_pointer_cast<const rvsdg::BitType>(resultType))
862 throw std::logic_error(
"Expected bitstring type.");
872 std::shared_ptr<const rvsdg::ControlType> srctype,
873 std::shared_ptr<const
jlm::rvsdg::BitType> dsttype)
878 operator==(
const Operation & other)
const noexcept override;
880 [[nodiscard]] std::string
883 [[nodiscard]] std::unique_ptr<Operation>
884 copy()
const override;
886 static std::unique_ptr<llvm::ThreeAddressCode>
887 create(
const Variable * operand,
const std::shared_ptr<const jlm::rvsdg::Type> & type)
889 auto st = std::dynamic_pointer_cast<const rvsdg::ControlType>(operand->
Type());
893 auto dt = std::dynamic_pointer_cast<const jlm::rvsdg::BitType>(type);
897 auto op = std::make_unique<ControlToIntOperation>(std::move(st), std::move(dt));
913 operator==(
const Operation & other)
const noexcept override;
915 [[nodiscard]] std::string
918 [[nodiscard]] std::unique_ptr<Operation>
919 copy()
const override;
921 static std::unique_ptr<FunctionToPointerOperation>
922 Create(std::shared_ptr<const rvsdg::FunctionType> fn);
924 const std::shared_ptr<const rvsdg::FunctionType> &
933 const auto functionType = std::dynamic_pointer_cast<const rvsdg::FunctionType>(operand.
Type());
936 throw std::logic_error(
"Expect function type.");
957 static std::optional<std::vector<rvsdg::Output *>>
960 const std::vector<rvsdg::Output *> & operands);
977 operator==(
const Operation & other)
const noexcept override;
979 [[nodiscard]] std::string
982 [[nodiscard]] std::unique_ptr<Operation>
983 copy()
const override;
985 static std::unique_ptr<PointerToFunctionOperation>
986 Create(std::shared_ptr<const rvsdg::FunctionType> fn);
988 const std::shared_ptr<const rvsdg::FunctionType> &
1009 static std::optional<std::vector<rvsdg::Output *>>
1012 const std::vector<rvsdg::Output *> & operands);
bool operator==(const Operation &other) const noexcept override
std::string debug_string() const override
BitCastOperation(const BitCastOperation &)=default
BitCastOperation(Operation &&)=delete
static std::unique_ptr< llvm::ThreeAddressCode > createTac(const Variable *operand, std::shared_ptr< const jlm::rvsdg::Type > type)
std::unique_ptr< Operation > copy() const override
static jlm::rvsdg::Output * create(jlm::rvsdg::Output *operand, std::shared_ptr< const jlm::rvsdg::Type > rtype)
BitCastOperation & operator=(const Operation &)=delete
~BitCastOperation() noexcept override
static std::pair< std::shared_ptr< const jlm::rvsdg::Type >, std::shared_ptr< const jlm::rvsdg::Type > > check_types(const std::shared_ptr< const jlm::rvsdg::Type > &otype, const std::shared_ptr< const jlm::rvsdg::Type > &rtype)
BitCastOperation & operator=(Operation &&)=delete
static std::unique_ptr< llvm::ThreeAddressCode > create(const Variable *operand, const std::shared_ptr< const jlm::rvsdg::Type > &type)
bool operator==(const Operation &other) const noexcept override
std::string debug_string() const override
~ControlToIntOperation() noexcept override
std::unique_ptr< Operation > copy() const override
const fpsize & srcsize() const noexcept
static std::unique_ptr< llvm::ThreeAddressCode > create(const Variable *operand, const std::shared_ptr< const rvsdg::Type > &resultType)
static std::optional< std::vector< rvsdg::Output * > > foldConstant(const FPExtOperation &operation, const std::vector< rvsdg::Output * > &operands)
static const FloatingPointType & checkAndExtractFloatingPointType(const rvsdg::Type &type)
FPExtOperation(const std::shared_ptr< const FloatingPointType > &operandType, const std::shared_ptr< const FloatingPointType > &resultType)
~FPExtOperation() noexcept override
std::string debug_string() const override
FPExtOperation(const std::shared_ptr< const rvsdg::Type > &operandType, const std::shared_ptr< const rvsdg::Type > &resultType)
bool operator==(const Operation &other) const noexcept override
std::unique_ptr< Operation > copy() const override
static rvsdg::SimpleNode & createNode(rvsdg::Output &operand, const std::shared_ptr< const rvsdg::Type > &resultType)
const fpsize & dstsize() const noexcept
~FPToSIOperation() noexcept override
std::unique_ptr< Operation > copy() const override
FPToSIOperation(const std::shared_ptr< const rvsdg::Type > &operandType, const std::shared_ptr< const rvsdg::Type > &resultType)
static std::unique_ptr< ThreeAddressCode > create(const Variable *operand, const std::shared_ptr< const rvsdg::Type > &type)
static std::shared_ptr< const FloatingPointType > checkAndExtractOperandType(const std::shared_ptr< const rvsdg::Type > &operandType)
static std::shared_ptr< const rvsdg::BitType > checkAndExtractResultType(const std::shared_ptr< const rvsdg::Type > &resultType)
bool operator==(const Operation &other) const noexcept override
FPToSIOperation(std::shared_ptr< const FloatingPointType > operandType, std::shared_ptr< const rvsdg::BitType > resultType)
std::string debug_string() const override
static std::shared_ptr< const rvsdg::BitType > checkAndExtractResultType(const std::shared_ptr< const rvsdg::Type > &resultType)
static std::shared_ptr< const FloatingPointType > checkAndExtractOperandType(const std::shared_ptr< const rvsdg::Type > &operandType)
~FPToUIOperation() noexcept override
static std::unique_ptr< ThreeAddressCode > create(const Variable *operand, const std::shared_ptr< const rvsdg::Type > &type)
bool operator==(const Operation &other) const noexcept override
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
FPToUIOperation(std::shared_ptr< const FloatingPointType > operandType, std::shared_ptr< const rvsdg::BitType > resultType)
FPToUIOperation(const std::shared_ptr< const rvsdg::Type > &operandType, const std::shared_ptr< const rvsdg::Type > &resultType)
bool operator==(const Operation &other) const noexcept override
FPTruncOperation(const std::shared_ptr< const FloatingPointType > &srctype, const std::shared_ptr< const FloatingPointType > &dsttype)
static std::optional< std::vector< rvsdg::Output * > > foldConstant(const FPTruncOperation &operation, const std::vector< rvsdg::Output * > &operands)
static const FloatingPointType & checkAndExtractFloatingPointType(const rvsdg::Type &type)
const fpsize & dstsize() const noexcept
static std::unique_ptr< llvm::ThreeAddressCode > create(const Variable *operand, std::shared_ptr< const jlm::rvsdg::Type > resultType)
const fpsize & srcsize() const noexcept
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
~FPTruncOperation() noexcept override
static rvsdg::SimpleNode & createNode(rvsdg::Output &operand, const std::shared_ptr< const rvsdg::Type > &resultType)
FPTruncOperation(const std::shared_ptr< const rvsdg::Type > &operandType, const std::shared_ptr< const rvsdg::Type > &resultType)
Get address of compiled function object.
std::unique_ptr< Operation > copy() const override
static rvsdg::SimpleNode & createNode(rvsdg::Output &operand)
static std::optional< std::vector< rvsdg::Output * > > invertFunctionToPointer(const FunctionToPointerOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::string debug_string() const override
bool operator==(const Operation &other) const noexcept override
std::shared_ptr< const rvsdg::FunctionType > FunctionType_
static std::unique_ptr< FunctionToPointerOperation > Create(std::shared_ptr< const rvsdg::FunctionType > fn)
~FunctionToPointerOperation() noexcept override
const std::shared_ptr< const rvsdg::FunctionType > & FunctionType() const noexcept
static std::unique_ptr< ThreeAddressCode > create(const Variable *argument)
bool operator==(const Operation &other) const noexcept override
static std::shared_ptr< const rvsdg::BitType > checkAndExtractOperandType(const std::shared_ptr< const rvsdg::Type > &operandType)
std::string debug_string() const override
~IntToPtrOperation() noexcept override
std::unique_ptr< Operation > copy() const override
static rvsdg::Output * create(rvsdg::Output *operand)
size_t nbits() const noexcept
IntToPtrOperation(const std::shared_ptr< const rvsdg::Type > &operandType, const std::shared_ptr< const rvsdg::Type > &)
Interpret pointer as callable function.
static std::optional< std::vector< rvsdg::Output * > > invertPointerToFunction(const PointerToFunctionOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
bool operator==(const Operation &other) const noexcept override
~PointerToFunctionOperation() noexcept override
const std::shared_ptr< const rvsdg::FunctionType > & FunctionType() const noexcept
static std::unique_ptr< PointerToFunctionOperation > Create(std::shared_ptr< const rvsdg::FunctionType > fn)
std::shared_ptr< const rvsdg::FunctionType > FunctionType_
static std::shared_ptr< const PointerType > Create()
std::unique_ptr< Operation > copy() const override
PtrToIntOperation(std::shared_ptr< const jlm::rvsdg::Type > srctype, std::shared_ptr< const jlm::rvsdg::Type > dsttype)
std::string debug_string() const override
static std::unique_ptr< llvm::ThreeAddressCode > create(const Variable *argument, const std::shared_ptr< const jlm::rvsdg::Type > &type)
bool operator==(const Operation &other) const noexcept override
~PtrToIntOperation() noexcept override
size_t nbits() const noexcept
static std::optional< std::vector< rvsdg::Output * > > foldConstant(const SExtOperation &operation, const std::vector< rvsdg::Output * > &operands)
static std::unique_ptr< llvm::ThreeAddressCode > createTac(const Variable *operand, const std::shared_ptr< const rvsdg::Type > &type)
~SExtOperation() noexcept override
static rvsdg::Output & create(size_t ndstbits, rvsdg::Output &operand)
static rvsdg::SimpleNode & createNode(const size_t numResultBits, rvsdg::Output &operand)
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
size_t nsrcbits() const noexcept
size_t ndstbits() const noexcept
bool operator==(const Operation &other) const noexcept override
~SIToFPOperation() noexcept override
std::unique_ptr< Operation > copy() const override
bool operator==(const Operation &other) const noexcept override
std::string debug_string() const override
static std::unique_ptr< llvm::ThreeAddressCode > create(const Variable *operand, const std::shared_ptr< const jlm::rvsdg::Type > &type)
SIToFPOperation(std::shared_ptr< const jlm::rvsdg::Type > srctype, std::shared_ptr< const jlm::rvsdg::Type > dsttype)
static std::unique_ptr< llvm::ThreeAddressCode > create(std::unique_ptr< rvsdg::SimpleOperation > operation, const std::vector< const Variable * > &operands)
std::string debug_string() const override
static rvsdg::SimpleNode & createNode(rvsdg::Output &operand, std::shared_ptr< const rvsdg::Type > resultType)
~TruncOperation() noexcept override
static std::shared_ptr< const rvsdg::BitType > checkBitType(const std::shared_ptr< const rvsdg::Type > &type)
bool operator==(const Operation &other) const noexcept override
TruncOperation(std::shared_ptr< const rvsdg::Type > operandType, std::shared_ptr< const rvsdg::Type > resultType)
size_t ndstbits() const noexcept
static std::optional< std::vector< rvsdg::Output * > > foldConstant(const TruncOperation &operation, const std::vector< rvsdg::Output * > &operands)
static rvsdg::Output & create(size_t ndstbits, rvsdg::Output &operand)
static std::unique_ptr< ThreeAddressCode > createTac(const Variable *operand, const std::shared_ptr< const rvsdg::Type > &resultType)
size_t nsrcbits() const noexcept
std::unique_ptr< Operation > copy() const override
bool operator==(const Operation &other) const noexcept override
std::string debug_string() const override
static std::unique_ptr< llvm::ThreeAddressCode > create(const Variable *operand, const std::shared_ptr< const jlm::rvsdg::Type > &type)
UIToFPOperation(std::shared_ptr< const jlm::rvsdg::Type > optype, std::shared_ptr< const jlm::rvsdg::Type > restype)
std::unique_ptr< Operation > copy() const override
~UIToFPOperation() noexcept override
const std::shared_ptr< const jlm::rvsdg::Type > Type() const noexcept
std::string debug_string() const override
size_t nsrcbits() const noexcept
static std::optional< std::vector< rvsdg::Output * > > foldConstant(const ZExtOperation &operation, const std::vector< rvsdg::Output * > &operands)
bool operator==(const Operation &other) const noexcept override
~ZExtOperation() noexcept override
static rvsdg::SimpleNode & createNode(const size_t numResultBits, rvsdg::Output &operand)
static rvsdg::Output & create(size_t ndstbits, rvsdg::Output &operand)
static std::unique_ptr< llvm::ThreeAddressCode > createTac(const Variable *operand, const std::shared_ptr< const jlm::rvsdg::Type > &type)
std::unique_ptr< Operation > copy() const override
size_t ndstbits() const noexcept
static std::shared_ptr< const BitType > Create(std::size_t nbits)
Creates bit type of specified width.
const std::shared_ptr< const rvsdg::Type > & Type() const noexcept
NodeOutput * output(size_t index) const noexcept
const std::shared_ptr< const rvsdg::Type > & argument(size_t index) const noexcept
const std::shared_ptr< const rvsdg::Type > & result(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)
UnaryOperation(std::shared_ptr< const Type > operand, std::shared_ptr< const Type > result)
Global memory state passed between functions.
@ Value
Designate a value type.
NodeType * TryGetOwnerNode(const rvsdg::Input &input) noexcept
Checks if this is an input to a node of specified type.