10 #include <llvm/ADT/SmallVector.h>
21 return op && op->
IncomingNodes_ == IncomingNodes_ && op->result(0) == result(0);
39 std::unique_ptr<rvsdg::Operation>
42 return std::make_unique<SsaPhiOperation>(*
this);
51 return op && op->
argument(0) == argument(0);
60 std::unique_ptr<rvsdg::Operation>
63 return std::make_unique<AssignmentOperation>(*
this);
72 return op && op->
result(0) == result(0);
81 std::unique_ptr<rvsdg::Operation>
84 return std::make_unique<SelectOperation>(*
this);
99 return "VectorSelect";
102 std::unique_ptr<rvsdg::Operation>
105 return std::make_unique<VectorSelectOperation>(*
this);
115 return op && op->
argument(0) == argument(0) && op->result(0) == result(0);
124 std::unique_ptr<rvsdg::Operation>
127 return std::make_unique<FloatingPointToUnsignedIntegerOperation>(*
this);
150 return op && op->
argument(0) == argument(0) && op->result(0) == result(0);
159 std::unique_ptr<rvsdg::Operation>
162 return std::make_unique<FloatingPointToSignedIntegerOperation>(*
this);
184 return op && op->
argument(0) == argument(0) && op->result(0) == result(0);
190 return "ControlToInt";
193 std::unique_ptr<rvsdg::Operation>
196 return std::make_unique<ControlToIntOperation>(*
this);
205 return op && op->
argument(0) == argument(0);
214 std::unique_ptr<rvsdg::Operation>
217 return std::make_unique<BranchOperation>(*
this);
232 return "ConstantPointerNull";
235 std::unique_ptr<rvsdg::Operation>
238 return std::make_unique<ConstantPointerNullOperation>(*
this);
247 return op && op->
argument(0) == argument(0) && op->result(0) == result(0);
256 std::unique_ptr<rvsdg::Operation>
259 return std::make_unique<IntegerToPointerOperation>(*
this);
280 return op && op->
argument(0) == argument(0) && op->result(0) == result(0);
289 std::unique_ptr<rvsdg::Operation>
292 return std::make_unique<PtrToIntOperation>(*
this);
313 return op && op->
result(0) == result(0);
319 return "ConstantDataArray";
322 std::unique_ptr<rvsdg::Operation>
325 return std::make_unique<ConstantDataArray>(*
this);
334 return op && op->
argument(0) == argument(0) && op->cmp_ == cmp_;
340 static std::unordered_map<llvm::cmp, std::string> map({ {
cmp::eq,
"eq" },
348 return "PtrCmp " + map[
cmp()];
351 std::unique_ptr<rvsdg::Operation>
354 return std::make_unique<PtrCmpOperation>(*
this);
379 return op && op->
argument(0) == argument(0) && op->result(0) == result(0);
388 std::unique_ptr<rvsdg::Operation>
391 return std::make_unique<ZExtOperation>(*
this);
398 if (rvsdg::IsOwnerNodeOperation<rvsdg::BitConstantOperation>(tracedOperand))
410 auto [_, constantOperation] =
411 rvsdg::TryGetSimpleNodeAndOptionalOp<rvsdg::BitConstantOperation>(tracedOperand);
414 *rvsdg::TryGetOwnerNode<rvsdg::Node>(*operand)->region(),
424 ConstantFP::operator==(const Operation & other) const noexcept
426 auto op =
dynamic_cast<const ConstantFP *
>(&other);
427 return op && size() == op->
size() && constant().bitwiseIsEqual(op->constant());
433 ::llvm::SmallVector<char, 32> v;
436 std::string s(
"FP(");
437 for (
const auto & c : v)
444 std::unique_ptr<rvsdg::Operation>
447 return std::make_unique<ConstantFP>(*
this);
456 return op && op->
argument(0) == argument(0) && op->cmp_ == cmp_;
462 static std::unordered_map<fpcmp, std::string> map({ {
fpcmp::oeq,
"oeq" },
478 return "FCmp " + map[
cmp()];
481 std::unique_ptr<rvsdg::Operation>
484 return std::make_unique<FCmpOperation>(*
this);
506 return op && op->
GetType() == GetType();
515 std::unique_ptr<rvsdg::Operation>
518 return std::make_unique<UndefValueOperation>(*
this);
527 return operation && operation->
GetType() == GetType();
536 std::unique_ptr<rvsdg::Operation>
539 return std::make_unique<PoisonValueOperation>(*
this);
548 return op && op->
fpop() ==
fpop() && op->size() == size();
554 static std::unordered_map<llvm::fpop, std::string> map({ {
fpop::add,
"add" },
561 return "FPOP " + map[
fpop()];
564 std::unique_ptr<rvsdg::Operation>
567 return std::make_unique<FBinaryOperation>(*
this);
592 return op && op->
srcsize() == srcsize() && op->dstsize() == dstsize();
601 std::unique_ptr<rvsdg::Operation>
604 return std::make_unique<FPExtOperation>(*
this);
625 return op && op->
size() == size();
634 std::unique_ptr<rvsdg::Operation>
637 return std::make_unique<FNegOperation>(*
this);
658 return op && op->
srcsize() == srcsize() && op->dstsize() == dstsize();
667 std::unique_ptr<rvsdg::Operation>
670 return std::make_unique<FPTruncOperation>(*
this);
691 if (!op || op->narguments() != narguments())
694 for (
size_t n = 0; n < narguments(); n++)
696 if (op->argument(n) != argument(n))
706 return "VariadicArguments";
709 std::unique_ptr<rvsdg::Operation>
712 return std::make_unique<VariadicArgumentListOperation>(*
this);
721 return op && op->
argument(0) == argument(0) && op->result(0) == result(0);
735 std::unique_ptr<rvsdg::Operation>
738 return std::make_unique<BitCastOperation>(*
this);
762 return op && op->
result(0) == result(0);
768 return "ConstantStruct";
771 std::unique_ptr<rvsdg::Operation>
774 return std::make_unique<ConstantStruct>(*
this);
783 return op && op->
argument(0) == argument(0) && op->result(0) == result(0);
792 std::unique_ptr<rvsdg::Operation>
795 return std::make_unique<TruncOperation>(*
this);
816 return op && op->
argument(0) == argument(0) && op->result(0) == result(0);
825 std::unique_ptr<rvsdg::Operation>
828 return std::make_unique<UIToFPOperation>(*
this);
849 return op && op->
argument(0) == argument(0) && op->result(0) == result(0);
858 std::unique_ptr<rvsdg::Operation>
861 return std::make_unique<SIToFPOperation>(*
this);
882 return op && op->
result(0) == result(0);
888 return "ConstantArray";
891 std::unique_ptr<rvsdg::Operation>
894 return std::make_unique<ConstantArrayOperation>(*
this);
903 return op && op->
result(0) == result(0);
909 return "ConstantAggregateZero";
912 std::unique_ptr<rvsdg::Operation>
915 return std::make_unique<ConstantAggregateZeroOperation>(*
this);
924 return op && op->
argument(0) == argument(0) && op->argument(1) == argument(1);
930 return "ExtractElement";
933 std::unique_ptr<rvsdg::Operation>
936 return std::make_unique<ExtractElementOperation>(*
this);
945 return op && op->
argument(0) == argument(0) && op->Mask() == Mask();
951 return "ShuffleVector";
954 std::unique_ptr<rvsdg::Operation>
957 return std::make_unique<ShuffleVectorOperation>(*
this);
966 return op && op->
result(0) == result(0);
972 return "ConstantVector";
975 std::unique_ptr<rvsdg::Operation>
978 return std::make_unique<ConstantVectorOperation>(*
this);
987 return op && op->
argument(0) == argument(0) && op->argument(1) == argument(1)
988 && op->argument(2) == argument(2);
994 return "InsertElement";
997 std::unique_ptr<rvsdg::Operation>
1000 return std::make_unique<InsertElementOperation>(*
this);
1009 return op && op->
operation() == operation();
1018 std::unique_ptr<rvsdg::Operation>
1021 return std::make_unique<VectorUnaryOperation>(*
this);
1030 return op && op->
operation() == operation();
1039 std::unique_ptr<rvsdg::Operation>
1042 return std::make_unique<VectorBinaryOperation>(*
this);
1051 return op && op->
result(0) == result(0);
1057 return "ConstantDataVector";
1060 std::unique_ptr<rvsdg::Operation>
1063 return std::make_unique<ConstantDataVectorOperation>(*
this);
1072 return op && op->
indices_ == indices_ && op->type() ==
type();
1078 return "ExtractValue";
1081 std::unique_ptr<rvsdg::Operation>
1084 return std::make_unique<ExtractValueOperation>(*
this);
1093 return this == &other;
1102 std::unique_ptr<rvsdg::Operation>
1105 return std::make_unique<MallocOperation>(*
this);
1116 return this == &other;
1125 std::unique_ptr<rvsdg::Operation>
1128 return std::make_unique<FreeOperation>(*
this);
std::unique_ptr< Operation > copy() const override
~AssignmentOperation() noexcept override
std::string debug_string() const override
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
jlm::rvsdg::Output * reduce_operand(jlm::rvsdg::unop_reduction_path_t path, jlm::rvsdg::Output *output) const override
jlm::rvsdg::unop_reduction_path_t can_reduce_operand(const jlm::rvsdg::Output *output) const noexcept override
~BitCastOperation() noexcept override
std::string debug_string() const override
~BranchOperation() noexcept override
std::unique_ptr< Operation > copy() const override
std::unique_ptr< Operation > copy() const override
~ConstantAggregateZeroOperation() noexcept override
std::string debug_string() const override
~ConstantArrayOperation() noexcept override
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
~ConstantDataArray() noexcept override
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
~ConstantDataVectorOperation() noexcept override
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
~ConstantFP() noexcept override
const fpsize & size() const noexcept
std::unique_ptr< Operation > copy() const override
const ::llvm::APFloat & constant() const noexcept
std::string debug_string() const override
ConstantPointerNullOperation class.
std::string debug_string() const override
const PointerType & GetPointerType() const noexcept
~ConstantPointerNullOperation() noexcept override
std::unique_ptr< Operation > copy() const override
bool operator==(const Operation &other) const noexcept override
std::string debug_string() const override
~ConstantStruct() override
std::unique_ptr< Operation > copy() const override
std::unique_ptr< Operation > copy() const override
~ConstantVectorOperation() noexcept override
std::string debug_string() const override
std::string debug_string() const override
~ControlToIntOperation() noexcept override
std::unique_ptr< Operation > copy() const override
const llvm::fpop & fpop() const noexcept
std::string debug_string() const override
jlm::rvsdg::binop_reduction_path_t can_reduce_operand_pair(const jlm::rvsdg::Output *op1, const jlm::rvsdg::Output *op2) const noexcept override
std::unique_ptr< Operation > copy() const override
jlm::rvsdg::Output * reduce_operand_pair(jlm::rvsdg::binop_reduction_path_t path, jlm::rvsdg::Output *op1, jlm::rvsdg::Output *op2) const override
~FBinaryOperation() noexcept override
jlm::rvsdg::binop_reduction_path_t can_reduce_operand_pair(const jlm::rvsdg::Output *op1, const jlm::rvsdg::Output *op2) const noexcept override
const fpcmp & cmp() const noexcept
~FCmpOperation() noexcept override
std::string debug_string() const override
jlm::rvsdg::Output * reduce_operand_pair(jlm::rvsdg::binop_reduction_path_t path, jlm::rvsdg::Output *op1, jlm::rvsdg::Output *op2) const override
std::unique_ptr< Operation > copy() const override
const fpsize & size() const noexcept
jlm::rvsdg::Output * reduce_operand(jlm::rvsdg::unop_reduction_path_t path, jlm::rvsdg::Output *output) const override
jlm::rvsdg::unop_reduction_path_t can_reduce_operand(const jlm::rvsdg::Output *output) const noexcept override
std::unique_ptr< Operation > copy() const override
~FNegOperation() noexcept override
std::string debug_string() const override
~FPExtOperation() noexcept override
std::string debug_string() const override
jlm::rvsdg::Output * reduce_operand(jlm::rvsdg::unop_reduction_path_t path, jlm::rvsdg::Output *output) const override
jlm::rvsdg::unop_reduction_path_t can_reduce_operand(const jlm::rvsdg::Output *output) const noexcept override
std::unique_ptr< Operation > copy() const override
const fpsize & srcsize() const noexcept
const fpsize & srcsize() const noexcept
jlm::rvsdg::unop_reduction_path_t can_reduce_operand(const jlm::rvsdg::Output *output) const noexcept override
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
~FPTruncOperation() noexcept override
jlm::rvsdg::Output * reduce_operand(jlm::rvsdg::unop_reduction_path_t path, jlm::rvsdg::Output *output) const override
jlm::rvsdg::Output * reduce_operand(jlm::rvsdg::unop_reduction_path_t path, jlm::rvsdg::Output *output) const override
jlm::rvsdg::unop_reduction_path_t can_reduce_operand(const jlm::rvsdg::Output *output) const noexcept override
~FloatingPointToSignedIntegerOperation() noexcept override
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
jlm::rvsdg::Output * reduce_operand(jlm::rvsdg::unop_reduction_path_t path, jlm::rvsdg::Output *output) const override
std::string debug_string() const override
jlm::rvsdg::unop_reduction_path_t can_reduce_operand(const jlm::rvsdg::Output *output) const noexcept override
std::unique_ptr< Operation > copy() const override
~FloatingPointToUnsignedIntegerOperation() noexcept override
std::unique_ptr< Operation > copy() const override
~FreeOperation() noexcept override
std::string debug_string() const override
std::string debug_string() const override
~InsertElementOperation() noexcept override
std::unique_ptr< Operation > copy() const override
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
jlm::rvsdg::unop_reduction_path_t can_reduce_operand(const jlm::rvsdg::Output *output) const noexcept override
~IntegerToPointerOperation() noexcept override
jlm::rvsdg::Output * reduce_operand(jlm::rvsdg::unop_reduction_path_t path, jlm::rvsdg::Output *output) const override
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
~MallocOperation() noexcept override
PoisonValueOperation class.
~PoisonValueOperation() noexcept override
std::string debug_string() const override
const jlm::rvsdg::Type & GetType() const noexcept
std::unique_ptr< Operation > copy() const override
~PtrCmpOperation() noexcept override
llvm::cmp cmp() const noexcept
jlm::rvsdg::binop_reduction_path_t can_reduce_operand_pair(const jlm::rvsdg::Output *op1, const jlm::rvsdg::Output *op2) const noexcept override
std::string debug_string() const override
jlm::rvsdg::Output * reduce_operand_pair(jlm::rvsdg::binop_reduction_path_t path, jlm::rvsdg::Output *op1, jlm::rvsdg::Output *op2) const override
std::unique_ptr< Operation > copy() const override
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
jlm::rvsdg::unop_reduction_path_t can_reduce_operand(const jlm::rvsdg::Output *output) const noexcept override
jlm::rvsdg::Output * reduce_operand(jlm::rvsdg::unop_reduction_path_t path, jlm::rvsdg::Output *output) const override
~PtrToIntOperation() noexcept override
~SIToFPOperation() noexcept override
jlm::rvsdg::unop_reduction_path_t can_reduce_operand(const jlm::rvsdg::Output *output) const noexcept override
std::unique_ptr< Operation > copy() const override
jlm::rvsdg::Output * reduce_operand(jlm::rvsdg::unop_reduction_path_t path, jlm::rvsdg::Output *output) const override
std::string debug_string() const override
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
~SelectOperation() noexcept override
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
~ShuffleVectorOperation() noexcept override
ControlFlowGraphNode * GetIncomingNode(size_t n) const noexcept
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
~SsaPhiOperation() noexcept override
std::vector< ControlFlowGraphNode * > IncomingNodes_
std::string debug_string() const override
~TruncOperation() noexcept override
jlm::rvsdg::unop_reduction_path_t can_reduce_operand(const jlm::rvsdg::Output *operand) const noexcept override
size_t ndstbits() const noexcept
jlm::rvsdg::Output * reduce_operand(jlm::rvsdg::unop_reduction_path_t path, jlm::rvsdg::Output *operand) const override
size_t nsrcbits() const noexcept
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
jlm::rvsdg::unop_reduction_path_t can_reduce_operand(const jlm::rvsdg::Output *operand) const noexcept override
jlm::rvsdg::Output * reduce_operand(jlm::rvsdg::unop_reduction_path_t path, jlm::rvsdg::Output *operand) const override
std::unique_ptr< Operation > copy() const override
~UIToFPOperation() noexcept override
UndefValueOperation class.
~UndefValueOperation() noexcept override
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
const rvsdg::Type & GetType() const noexcept
std::string debug_string() const override
~VariadicArgumentListOperation() noexcept override
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
const rvsdg::BinaryOperation & operation() const noexcept
~VectorBinaryOperation() noexcept override
std::unique_ptr< Operation > copy() const override
const rvsdg::Type & type() const noexcept
std::string debug_string() const override
~VectorSelectOperation() noexcept override
~VectorUnaryOperation() noexcept override
std::string debug_string() const override
const rvsdg::UnaryOperation & operation() const noexcept
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
size_t nsrcbits() const noexcept
jlm::rvsdg::Output * reduce_operand(jlm::rvsdg::unop_reduction_path_t path, jlm::rvsdg::Output *operand) const override
~ZExtOperation() noexcept override
std::unique_ptr< Operation > copy() const override
jlm::rvsdg::unop_reduction_path_t can_reduce_operand(const jlm::rvsdg::Output *operand) const noexcept override
size_t ndstbits() const noexcept
static Output & create(Region ®ion, BitValueRepresentation value)
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
size_t narguments() const noexcept
#define JLM_UNREACHABLE(msg)
Global memory state passed between functions.
size_t unop_reduction_path_t
static std::string type(const Node *n)
size_t binop_reduction_path_t
static const unop_reduction_path_t unop_reduction_constant
static const unop_reduction_path_t unop_reduction_none
Output & traceOutputIntraProcedurally(Output &output)
static const binop_reduction_path_t binop_reduction_none
static std::string strfmt(Args... args)