12template<
typename TBinOp>
16 static_assert(std::is_base_of_v<IntegerBinaryOperation, TBinOp>);
18 if constexpr (std::is_same_v<TBinOp, IntegerEqOperation>)
20 else if constexpr (std::is_same_v<TBinOp, IntegerNeOperation>)
22 else if constexpr (std::is_same_v<TBinOp, IntegerSgeOperation>)
24 else if constexpr (std::is_same_v<TBinOp, IntegerSgtOperation>)
26 else if constexpr (std::is_same_v<TBinOp, IntegerSleOperation>)
28 else if constexpr (std::is_same_v<TBinOp, IntegerSltOperation>)
30 else if constexpr (std::is_same_v<TBinOp, IntegerUgeOperation>)
32 else if constexpr (std::is_same_v<TBinOp, IntegerUgtOperation>)
34 else if constexpr (std::is_same_v<TBinOp, IntegerUleOperation>)
36 else if constexpr (std::is_same_v<TBinOp, IntegerUltOperation>)
38 else if constexpr (std::is_same_v<TBinOp, IntegerAddOperation>)
40 else if constexpr (std::is_same_v<TBinOp, IntegerSubOperation>)
42 else if constexpr (std::is_same_v<TBinOp, IntegerMulOperation>)
44 else if constexpr (std::is_same_v<TBinOp, IntegerSDivOperation>)
46 else if constexpr (std::is_same_v<TBinOp, IntegerUDivOperation>)
48 else if constexpr (std::is_same_v<TBinOp, IntegerSRemOperation>)
50 else if constexpr (std::is_same_v<TBinOp, IntegerURemOperation>)
52 else if constexpr (std::is_same_v<TBinOp, IntegerAShrOperation>)
54 else if constexpr (std::is_same_v<TBinOp, IntegerShlOperation>)
56 else if constexpr (std::is_same_v<TBinOp, IntegerLShrOperation>)
58 else if constexpr (std::is_same_v<TBinOp, IntegerOrOperation>)
60 else if constexpr (std::is_same_v<TBinOp, IntegerAndOperation>)
62 else if constexpr (std::is_same_v<TBinOp, IntegerXorOperation>)
65 static_assert(
sizeof(TBinOp) == 0,
"Unsupported binary operation!");
75template<
typename TBinOp>
76static std::optional<std::vector<rvsdg::Output *>>
79 static_assert(std::is_base_of_v<IntegerBinaryOperation, TBinOp>);
82 auto & operand1 = *operands[0];
83 auto & operand2 = *operands[1];
86 auto [c1Node, c1Operation] =
92 auto [c2Node, c2Operation] =
97 auto & c1Representation = c1Operation->Representation();
98 auto & c2Representation = c2Operation->Representation();
99 const auto & resultRepresentation =
100 foldBinaryOperation<TBinOp>(c1Representation, c2Representation);
105 return std::vector<rvsdg::Output *>({ result });
110std::unique_ptr<rvsdg::Operation>
113 return std::make_unique<IntegerConstantOperation>(*
this);
129 return constant && constant->
Representation() == Representation();
140 return addOperation && addOperation->
Type() == Type();
149std::unique_ptr<rvsdg::Operation>
152 return std::make_unique<IntegerAddOperation>(*
this);
174 return flags::associative | flags::commutative;
177std::optional<std::vector<rvsdg::Output *>>
180 const std::vector<rvsdg::Output *> & operands)
182 return foldBinaryOperationConstants<IntegerAddOperation>(operands);
191 return subOperation && subOperation->
Type() == Type();
200std::unique_ptr<rvsdg::Operation>
203 return std::make_unique<IntegerSubOperation>(*
this);
228std::optional<std::vector<rvsdg::Output *>>
231 const std::vector<rvsdg::Output *> & operands)
234 const auto & operand1 = *operands[0];
235 const auto & operand2 = *operands[1];
240 if (&tracedOperand1 != &tracedOperand2)
247std::optional<std::vector<rvsdg::Output *>>
250 const std::vector<rvsdg::Output *> & operands)
252 return foldBinaryOperationConstants<IntegerSubOperation>(operands);
261 return mulOperation && mulOperation->
Type() == Type();
270std::unique_ptr<rvsdg::Operation>
273 return std::make_unique<IntegerMulOperation>(*
this);
295 return flags::associative | flags::commutative;
298std::optional<std::vector<rvsdg::Output *>>
301 const std::vector<rvsdg::Output *> & operands)
303 return foldBinaryOperationConstants<IntegerMulOperation>(operands);
312 return sdivOperation && sdivOperation->
Type() == Type();
321std::unique_ptr<rvsdg::Operation>
324 return std::make_unique<IntegerSDivOperation>(*
this);
349std::optional<std::vector<rvsdg::Output *>>
352 const std::vector<rvsdg::Output *> & operands)
354 return foldBinaryOperationConstants<IntegerSDivOperation>(operands);
363 return udivOperation && udivOperation->
Type() == Type();
372std::unique_ptr<rvsdg::Operation>
375 return std::make_unique<IntegerUDivOperation>(*
this);
400std::optional<std::vector<rvsdg::Output *>>
403 const std::vector<rvsdg::Output *> & operands)
405 return foldBinaryOperationConstants<IntegerUDivOperation>(operands);
414 return smodOperation && smodOperation->
Type() == Type();
423std::unique_ptr<rvsdg::Operation>
426 return std::make_unique<IntegerSRemOperation>(*
this);
451std::optional<std::vector<rvsdg::Output *>>
454 const std::vector<rvsdg::Output *> & operands)
456 return foldBinaryOperationConstants<IntegerSRemOperation>(operands);
465 return umodOperation && umodOperation->
Type() == Type();
474std::unique_ptr<rvsdg::Operation>
477 return std::make_unique<IntegerURemOperation>(*
this);
502std::optional<std::vector<rvsdg::Output *>>
505 const std::vector<rvsdg::Output *> & operands)
507 return foldBinaryOperationConstants<IntegerURemOperation>(operands);
516 return ashrOperation && ashrOperation->
Type() == Type();
525std::unique_ptr<rvsdg::Operation>
528 return std::make_unique<IntegerAShrOperation>(*
this);
553std::optional<std::vector<rvsdg::Output *>>
556 const std::vector<rvsdg::Output *> & operands)
558 return foldBinaryOperationConstants<IntegerAShrOperation>(operands);
567 return shlOperation && shlOperation->
Type() == Type();
576std::unique_ptr<rvsdg::Operation>
579 return std::make_unique<IntegerShlOperation>(*
this);
604std::optional<std::vector<rvsdg::Output *>>
607 const std::vector<rvsdg::Output *> & operands)
609 return foldBinaryOperationConstants<IntegerShlOperation>(operands);
618 return shrOperation && shrOperation->
Type() == Type();
627std::unique_ptr<rvsdg::Operation>
630 return std::make_unique<IntegerLShrOperation>(*
this);
655std::optional<std::vector<rvsdg::Output *>>
658 const std::vector<rvsdg::Output *> & operands)
660 return foldBinaryOperationConstants<IntegerLShrOperation>(operands);
669 return andOperation && andOperation->
Type() == Type();
678std::unique_ptr<rvsdg::Operation>
681 return std::make_unique<IntegerAndOperation>(*
this);
703 return flags::associative | flags::commutative;
706std::optional<std::vector<rvsdg::Output *>>
709 const std::vector<rvsdg::Output *> & operands)
711 return foldBinaryOperationConstants<IntegerAndOperation>(operands);
720 return orOperation && orOperation->
Type() == Type();
729std::unique_ptr<rvsdg::Operation>
732 return std::make_unique<IntegerOrOperation>(*
this);
754 return flags::associative | flags::commutative;
757std::optional<std::vector<rvsdg::Output *>>
760 const std::vector<rvsdg::Output *> & operands)
762 return foldBinaryOperationConstants<IntegerOrOperation>(operands);
771 return xorOperation && xorOperation->
Type() == Type();
780std::unique_ptr<rvsdg::Operation>
783 return std::make_unique<IntegerXorOperation>(*
this);
805 return flags::associative | flags::commutative;
808std::optional<std::vector<rvsdg::Output *>>
811 const std::vector<rvsdg::Output *> & operands)
813 return foldBinaryOperationConstants<IntegerXorOperation>(operands);
822 return eqOperation && eqOperation->
result(0) == result(0);
831std::unique_ptr<rvsdg::Operation>
834 return std::make_unique<IntegerEqOperation>(*
this);
856 return flags::commutative;
859std::optional<std::vector<rvsdg::Output *>>
862 const std::vector<rvsdg::Output *> & operands)
864 return foldBinaryOperationConstants<IntegerEqOperation>(operands);
873 return neOperation && neOperation->
result(0) == result(0);
882std::unique_ptr<rvsdg::Operation>
885 return std::make_unique<IntegerNeOperation>(*
this);
907 return flags::commutative;
910std::optional<std::vector<rvsdg::Output *>>
913 const std::vector<rvsdg::Output *> & operands)
915 return foldBinaryOperationConstants<IntegerNeOperation>(operands);
924 return sgeOperation && sgeOperation->
result(0) == result(0);
933std::unique_ptr<rvsdg::Operation>
936 return std::make_unique<IntegerSgeOperation>(*
this);
961std::optional<std::vector<rvsdg::Output *>>
964 const std::vector<rvsdg::Output *> & operands)
966 return foldBinaryOperationConstants<IntegerSgeOperation>(operands);
975 return sgtOperation && sgtOperation->
result(0) == result(0);
984std::unique_ptr<rvsdg::Operation>
987 return std::make_unique<IntegerSgtOperation>(*
this);
1012std::optional<std::vector<rvsdg::Output *>>
1015 const std::vector<rvsdg::Output *> & operands)
1017 return foldBinaryOperationConstants<IntegerSgtOperation>(operands);
1026 return sleOperation && sleOperation->
result(0) == result(0);
1035std::unique_ptr<rvsdg::Operation>
1038 return std::make_unique<IntegerSleOperation>(*
this);
1063std::optional<std::vector<rvsdg::Output *>>
1066 const std::vector<rvsdg::Output *> & operands)
1068 return foldBinaryOperationConstants<IntegerSleOperation>(operands);
1077 return sltOperation && sltOperation->
result(0) == result(0);
1086std::unique_ptr<rvsdg::Operation>
1089 return std::make_unique<IntegerSltOperation>(*
this);
1114std::optional<std::vector<rvsdg::Output *>>
1117 const std::vector<rvsdg::Output *> & operands)
1119 return foldBinaryOperationConstants<IntegerSltOperation>(operands);
1128 return ugeOperation && ugeOperation->
result(0) == result(0);
1137std::unique_ptr<rvsdg::Operation>
1140 return std::make_unique<IntegerUgeOperation>(*
this);
1165std::optional<std::vector<rvsdg::Output *>>
1168 const std::vector<rvsdg::Output *> & operands)
1170 return foldBinaryOperationConstants<IntegerUgeOperation>(operands);
1179 return ugtOperation && ugtOperation->
result(0) == result(0);
1188std::unique_ptr<rvsdg::Operation>
1191 return std::make_unique<IntegerUgtOperation>(*
this);
1216std::optional<std::vector<rvsdg::Output *>>
1219 const std::vector<rvsdg::Output *> & operands)
1221 return foldBinaryOperationConstants<IntegerUgtOperation>(operands);
1230 return uleOperation && uleOperation->
result(0) == result(0);
1239std::unique_ptr<rvsdg::Operation>
1242 return std::make_unique<IntegerUleOperation>(*
this);
1267std::optional<std::vector<rvsdg::Output *>>
1270 const std::vector<rvsdg::Output *> & operands)
1272 return foldBinaryOperationConstants<IntegerUleOperation>(operands);
1281 return ultOperation && ultOperation->
result(0) == result(0);
1290std::unique_ptr<rvsdg::Operation>
1293 return std::make_unique<IntegerUltOperation>(*
this);
1318std::optional<std::vector<rvsdg::Output *>>
1321 const std::vector<rvsdg::Output *> & operands)
1323 return foldBinaryOperationConstants<IntegerUltOperation>(operands);
std::unique_ptr< Operation > copy() const override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerAShrOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::string debug_string() const override
enum flags flags() const noexcept override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
~IntegerAShrOperation() noexcept override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
enum flags flags() const noexcept override
std::string debug_string() const override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerAddOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::unique_ptr< Operation > copy() const override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
std::unique_ptr< Operation > copy() const override
enum flags flags() const noexcept override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerAndOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::string debug_string() const override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
~IntegerAndOperation() noexcept override
~IntegerBinaryOperation() noexcept override
const rvsdg::BitType & Type() const noexcept
static rvsdg::Node & Create(rvsdg::Region ®ion, IntegerValueRepresentation representation)
~IntegerConstantOperation() override
bool operator==(const Operation &other) const noexcept override
const IntegerValueRepresentation & Representation() const noexcept
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
enum flags flags() const noexcept override
std::string debug_string() const override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerEqOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::unique_ptr< Operation > copy() const override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
~IntegerEqOperation() noexcept override
~IntegerLShrOperation() noexcept override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerLShrOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
enum flags flags() const noexcept override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
~IntegerMulOperation() noexcept override
std::string debug_string() const override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerMulOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::unique_ptr< Operation > copy() const override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
enum flags flags() const noexcept override
std::string debug_string() const override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerNeOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::unique_ptr< Operation > copy() const override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
enum flags flags() const noexcept override
~IntegerNeOperation() noexcept override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerOrOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::unique_ptr< Operation > copy() const override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
~IntegerOrOperation() noexcept override
enum flags flags() const noexcept override
std::string debug_string() const override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerSDivOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::string debug_string() const override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
~IntegerSDivOperation() noexcept override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
std::unique_ptr< Operation > copy() const override
enum flags flags() const noexcept override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerSRemOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::string debug_string() const override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
~IntegerSRemOperation() noexcept override
std::unique_ptr< Operation > copy() const override
enum flags flags() const noexcept override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerSgeOperation &operation, const std::vector< rvsdg::Output * > &operands)
enum flags flags() const noexcept override
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
~IntegerSgeOperation() noexcept override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerSgtOperation &operation, const std::vector< rvsdg::Output * > &operands)
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
enum flags flags() const noexcept override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
~IntegerSgtOperation() noexcept override
std::unique_ptr< Operation > copy() const override
~IntegerShlOperation() noexcept override
enum flags flags() const noexcept override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
std::string debug_string() const override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerShlOperation &operation, const std::vector< rvsdg::Output * > &operands)
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
std::string debug_string() const override
enum flags flags() const noexcept override
~IntegerSleOperation() noexcept override
std::unique_ptr< Operation > copy() const override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerSleOperation &operation, const std::vector< rvsdg::Output * > &operands)
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
std::unique_ptr< Operation > copy() const override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
std::string debug_string() const override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerSltOperation &operation, const std::vector< rvsdg::Output * > &operands)
enum flags flags() const noexcept override
~IntegerSltOperation() noexcept override
~IntegerSubOperation() noexcept override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
std::string debug_string() const override
enum flags flags() const noexcept override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerSubOperation &operation, const std::vector< rvsdg::Output * > &operands)
static std::optional< std::vector< rvsdg::Output * > > normalizeAdditiveInverse(const IntegerSubOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::unique_ptr< Operation > copy() const override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerUDivOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::string debug_string() const override
~IntegerUDivOperation() noexcept override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
enum flags flags() const noexcept override
std::unique_ptr< Operation > copy() const override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
enum flags flags() const noexcept override
~IntegerURemOperation() noexcept override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerURemOperation &operation, const std::vector< rvsdg::Output * > &operands)
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerUgeOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
~IntegerUgeOperation() noexcept override
enum flags flags() const noexcept override
enum flags flags() const noexcept override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
~IntegerUgtOperation() noexcept override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerUgtOperation &operation, const std::vector< rvsdg::Output * > &operands)
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
enum flags flags() const noexcept override
std::string debug_string() const override
~IntegerUleOperation() noexcept override
std::unique_ptr< Operation > copy() const override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerUleOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::unique_ptr< Operation > copy() const override
enum flags flags() const noexcept override
std::string debug_string() const override
~IntegerUltOperation() noexcept override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerUltOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::string debug_string() const override
rvsdg::Output * reduce_operand_pair(rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
~IntegerXorOperation() noexcept override
enum flags flags() const noexcept override
static std::optional< std::vector< rvsdg::Output * > > foldConstants(const IntegerXorOperation &operation, const std::vector< rvsdg::Output * > &operands)
std::unique_ptr< Operation > copy() const override
rvsdg::binop_reduction_path_t can_reduce_operand_pair(const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
size_t nbits() const noexcept
BitValueRepresentation shl(size_t shift) const
void udiv(const BitValueRepresentation &divisor, BitValueRepresentation "ient, BitValueRepresentation &remainder) const
BitValueRepresentation smod(const BitValueRepresentation &other) const
void mul(const BitValueRepresentation &factor1, const BitValueRepresentation &factor2, BitValueRepresentation &product) const
char sgt(const BitValueRepresentation &other) const
char sge(const BitValueRepresentation &other) const
BitValueRepresentation sdiv(const BitValueRepresentation &other) const
char ne(const BitValueRepresentation &other) const
char ule(const BitValueRepresentation &other) const
char ult(const BitValueRepresentation &other) const
char lor(char a, char b) const noexcept
char ugt(const BitValueRepresentation &other) const
char eq(const BitValueRepresentation &other) const
char lxor(char a, char b) const noexcept
BitValueRepresentation sub(const BitValueRepresentation &other) const
char slt(const BitValueRepresentation &other) const
BitValueRepresentation ashr(size_t shift) const
BitValueRepresentation shr(size_t shift) const
BitValueRepresentation umod(const BitValueRepresentation &other) const
char sle(const BitValueRepresentation &other) const
char land(char a, char b) const noexcept
char uge(const BitValueRepresentation &other) const
char add(char a, char b, char c) const noexcept
NodeOutput * output(size_t index) const noexcept
const std::shared_ptr< const rvsdg::Type > & result(size_t index) const noexcept
Global memory state passed between functions.
rvsdg::Output & traceOutput(rvsdg::Output &output, const rvsdg::Region *withinRegion)
rvsdg::BitValueRepresentation IntegerValueRepresentation
static IntegerValueRepresentation foldBinaryOperation(const IntegerValueRepresentation &r1, const IntegerValueRepresentation &r2)
static std::optional< std::vector< rvsdg::Output * > > foldBinaryOperationConstants(const std::vector< rvsdg::Output * > &operands)
static std::vector< jlm::rvsdg::Output * > outputs(const Node *node)
size_t binop_reduction_path_t
NodeType * TryGetOwnerNode(const rvsdg::Input &input) noexcept
Checks if this is an input to a node of specified type.
static const binop_reduction_path_t binop_reduction_none
static std::string strfmt(Args... args)