6 #ifndef JLM_HLS_IR_HLS_HPP
7 #define JLM_HLS_IR_HLS_HPP
38 const std::shared_ptr<const
jlm::rvsdg::
Type> &
type,
42 { nalternatives,
type }),
52 && *ot->result(0) == *
result(0);
61 [[nodiscard]] std::unique_ptr<Operation>
64 return std::make_unique<BranchOperation>(*
this);
67 static std::vector<jlm::rvsdg::Output *>
70 auto ctl = std::dynamic_pointer_cast<const rvsdg::ControlType>(predicate.
Type());
72 throw util::Error(
"Predicate needs to be a control type.");
74 return outputs(&rvsdg::CreateOpNode<BranchOperation>(
75 { &predicate, &value },
119 size_t nalternatives,
120 const std::shared_ptr<const jlm::rvsdg::Type> &
type,
129 const auto forkOp =
dynamic_cast<const ForkOperation *
>(&other);
142 return IsConstant() ?
"HLS_CFORK" :
"HLS_FORK";
145 [[nodiscard]] std::unique_ptr<Operation>
148 return std::make_unique<ForkOperation>(*
this);
160 static std::vector<jlm::rvsdg::Output *>
164 &rvsdg::CreateOpNode<ForkOperation>({ &value }, nalternatives, value.
Type(), isConstant));
179 return rvsdg::CreateOpNode<ForkOperation>({ &operand }, numResults, operand.
Type(), isConstant);
204 size_t nalternatives,
205 const std::shared_ptr<const
jlm::rvsdg::
Type> &
type,
216 const auto ot =
dynamic_cast<const MuxOperation *
>(&other);
228 [[nodiscard]] std::unique_ptr<Operation>
231 return std::make_unique<MuxOperation>(*
this);
234 static std::vector<jlm::rvsdg::Output *>
237 const std::vector<jlm::rvsdg::Output *> & alternatives,
241 if (alternatives.empty())
242 throw util::Error(
"Insufficient number of operands.");
243 auto ctl = std::dynamic_pointer_cast<const rvsdg::ControlType>(predicate.
Type());
245 throw util::Error(
"Predicate needs to be a control type.");
246 if (alternatives.size() != ctl->nalternatives())
247 throw util::Error(
"Alternatives and predicate do not match.");
249 auto operands = std::vector<jlm::rvsdg::Output *>();
252 return outputs(&rvsdg::CreateOpNode<MuxOperation>(
255 alternatives.front()->Type(),
263 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
267 std::vector<std::shared_ptr<const jlm::rvsdg::Type>>(nalternatives + 1, std::move(
type));
295 [[nodiscard]] std::unique_ptr<Operation>
298 return std::make_unique<SinkOperation>(*
this);
301 static std::vector<jlm::rvsdg::Output *>
304 return outputs(&rvsdg::CreateOpNode<SinkOperation>({ &value }, value.
Type()));
327 return "HLS_PRED_BUF";
330 [[nodiscard]] std::unique_ptr<Operation>
333 return std::make_unique<PredicateBufferOperation>(*
this);
336 static std::vector<jlm::rvsdg::Output *>
339 auto ctl = std::dynamic_pointer_cast<const rvsdg::ControlType>(predicate.
Type());
341 throw util::Error(
"Predicate needs to be a control type.");
343 return outputs(&rvsdg::CreateOpNode<PredicateBufferOperation>({ &predicate }, ctl));
353 const std::shared_ptr<const rvsdg::
ControlType> & ctltype,
354 const std::shared_ptr<const
jlm::rvsdg::
Type> &
type)
368 return "HLS_LOOP_CONST_BUF";
371 [[nodiscard]] std::unique_ptr<Operation>
374 return std::make_unique<LoopConstantBufferOperation>(*
this);
377 static std::vector<jlm::rvsdg::Output *>
380 auto ctl = std::dynamic_pointer_cast<const rvsdg::ControlType>(predicate.
Type());
382 throw util::Error(
"Predicate needs to be a control type.");
384 return outputs(&rvsdg::CreateOpNode<LoopConstantBufferOperation>(
385 { &predicate, &value },
397 const std::shared_ptr<const
jlm::rvsdg::
Type> &
type,
405 [[nodiscard]] std::size_t
422 && *ot->result(0) == *
result(0);
425 [[nodiscard]] std::string
431 [[nodiscard]] std::unique_ptr<Operation>
434 return std::make_unique<BufferOperation>(*
this);
437 static std::vector<jlm::rvsdg::Output *>
441 &rvsdg::CreateOpNode<BufferOperation>({ &value }, value.
Type(), capacity, pass_through));
465 return jlm::rvsdg::is<TriggerType>(other);
468 [[nodiscard]] std::size_t
472 Kind() const noexcept override;
492 return ot && *ot->
argument(1) == *argument(1) && *ot->result(0) == *result(0);
498 return "HLS_TRIGGER";
501 [[nodiscard]] std::unique_ptr<Operation>
504 return std::make_unique<TriggerOperation>(*
this);
507 static std::vector<jlm::rvsdg::Output *>
510 if (!rvsdg::is<TriggerType>(tg.
Type()))
511 throw util::Error(
"Trigger needs to be a TriggerType.");
513 return outputs(&rvsdg::CreateOpNode<TriggerOperation>({ &tg, &value }, value.
Type()));
527 static size_t common_id{ 0 };
550 [[nodiscard]] std::unique_ptr<Operation>
553 return std::make_unique<PrintOperation>(*
this);
556 static std::vector<jlm::rvsdg::Output *>
559 return outputs(&rvsdg::CreateOpNode<PrintOperation>({ &value }, value.
Type()));
574 [[nodiscard]] std::unique_ptr<Operation>
577 return std::make_unique<LoopOperation>(*
this);
581 class BackEdgeArgument;
582 class BackEdgeResult;
595 const std::shared_ptr<const rvsdg::Type>
type)
611 const std::shared_ptr<const rvsdg::
Type>
type)
613 std::unique_ptr<EntryArgument> argument(
new EntryArgument(region, input, std::move(
type)));
614 return static_cast<EntryArgument &
>(region.addArgument(std::move(argument)));
675 std::unique_ptr<BackEdgeResult> result(
new BackEdgeResult(origin));
702 std::unique_ptr<RegionResult> result(
new ExitResult(origin, output));
703 return static_cast<ExitResult &
>(origin.region()->addResult(std::move(result)));
719 GetOperation() const noexcept override;
722 create(rvsdg::
Region * parent,
bool init = true);
725 subregion() const noexcept
733 auto result = subregion()->result(0);
734 JLM_ASSERT(rvsdg::is<const rvsdg::ControlType>(result->Type()));
741 return *PredicateBuffer_;
748 add_backedge(std::shared_ptr<const jlm::rvsdg::Type>
type);
828 const std::vector<std::pair<std::
string, std::shared_ptr<const
Type>>> elements)
829 : elements_(std::move(elements))
847 if (!
type ||
type->elements_.size() != elements_.size())
851 for (
size_t i = 0; i < elements_.size(); ++i)
853 if (
type->elements_.at(i).first != elements_.at(i).first
854 || *
type->elements_.at(i).second != *elements_.at(i).second)
862 [[nodiscard]] std::size_t
866 Kind() const noexcept override;
868 std::shared_ptr<const
jlm::rvsdg::
Type>
869 get_element_type(std::
string element)
const
871 for (
size_t i = 0; i < elements_.size(); ++i)
873 if (elements_.at(i).first == element)
875 return elements_.at(i).second;
882 [[nodiscard]] std::string
890 const std::vector<std::pair<std::string, std::shared_ptr<const jlm::rvsdg::Type>>>
elements_;
893 std::shared_ptr<const BundleType>
894 get_mem_req_type(std::shared_ptr<const rvsdg::Type> elementType,
bool write);
896 std::shared_ptr<const BundleType>
906 CreateInTypes(pointeeType, numStates),
907 CreateOutTypes(pointeeType, numStates))
915 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
918 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
919 CreateInTypes(std::shared_ptr<const rvsdg::Type> pointeeType,
size_t numStates)
921 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(
924 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> states(
927 types.insert(types.end(), states.begin(), states.end());
928 types.emplace_back(std::move(pointeeType));
932 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
935 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(1, std::move(pointeeType));
936 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> states(
939 types.insert(types.end(), states.begin(), states.end());
947 return "HLS_LOAD_" + argument(narguments() - 1)->debug_string();
950 [[nodiscard]] std::unique_ptr<Operation>
953 return std::make_unique<LoadOperation>(*
this);
956 static std::vector<jlm::rvsdg::Output *>
959 const std::vector<jlm::rvsdg::Output *> & states,
962 std::vector<jlm::rvsdg::Output *> inputs;
963 inputs.push_back(&addr);
964 inputs.insert(inputs.end(), states.begin(), states.end());
965 inputs.push_back(&load_result);
966 return outputs(&rvsdg::CreateOpNode<LoadOperation>(inputs, load_result.
Type(), states.size()));
972 return *util::assertedCast<const llvm::PointerType>(argument(0).get());
975 [[nodiscard]] std::shared_ptr<const rvsdg::Type>
991 :
SimpleOperation(CreateInTypes(pointerType), CreateOutTypes(pointerType)),
992 combinatorial(combinatorial),
1001 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1004 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1008 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(2, std::move(pointerType));
1013 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1016 return { std::move(pointerType) };
1024 return "HLS_ADDR_QUEUE_COMB_" + argument(narguments() - 1)->debug_string();
1026 return "HLS_ADDR_QUEUE_" + argument(narguments() - 1)->debug_string();
1029 [[nodiscard]] std::unique_ptr<Operation>
1032 return std::make_unique<AddressQueueOperation>(*
this);
1041 size_t capacity = 10)
1043 return rvsdg::CreateOpNode<AddressQueueOperation>(
1044 { &check, &enq, &deq },
1045 std::dynamic_pointer_cast<const llvm::PointerType>(check.
Type()),
1069 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1072 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1075 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(1,
type);
1076 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> states(
1079 types.insert(types.end(), states.begin(), states.end());
1086 return "HLS_STATE_GATE_" + argument(narguments() - 1)->debug_string();
1089 [[nodiscard]] std::unique_ptr<Operation>
1092 return std::make_unique<StateGateOperation>(*
this);
1095 static std::vector<jlm::rvsdg::Output *>
1098 std::vector<jlm::rvsdg::Output *> inputs;
1099 inputs.push_back(&addr);
1100 inputs.insert(inputs.end(), states.begin(), states.end());
1101 return outputs(&rvsdg::CreateOpNode<StateGateOperation>(inputs, addr.
Type(), states.size()));
1111 :
SimpleOperation(CreateInTypes(pointeeType), CreateOutTypes(pointeeType)),
1120 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1123 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1126 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types = {
1133 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1136 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types = {
1146 return "HLS_DEC_LOAD_" + std::to_string(capacity) +
"_"
1147 + argument(narguments() - 1)->debug_string();
1150 [[nodiscard]] std::unique_ptr<Operation>
1153 return std::make_unique<DecoupledLoadOperation>(*
this);
1156 static std::vector<jlm::rvsdg::Output *>
1159 std::vector<jlm::rvsdg::Output *> inputs;
1160 inputs.push_back(&addr);
1161 inputs.push_back(&load_result);
1164 &rvsdg::CreateOpNode<DecoupledLoadOperation>(inputs, load_result.
Type(), capacity));
1170 return *util::assertedCast<const llvm::PointerType>(argument(0).get());
1173 [[nodiscard]] std::shared_ptr<const rvsdg::Type>
1188 const std::vector<std::shared_ptr<const rvsdg::
Type>> & output_types,
1190 :
SimpleOperation(CreateInTypes(in_width), CreateOutTypes(output_types))
1198 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1201 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1204 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types;
1209 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1212 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types;
1213 types.reserve(output_types.size());
1214 for (
auto outputType : output_types)
1216 types.emplace_back(outputType);
1224 return "HLS_MEM_RESP";
1227 [[nodiscard]] std::unique_ptr<Operation>
1230 return std::make_unique<MemoryResponseOperation>(*
this);
1233 static std::vector<jlm::rvsdg::Output *>
1236 const std::vector<std::shared_ptr<const rvsdg::Type>> & output_types,
1240 &rvsdg::CreateOpNode<MemoryResponseOperation>({ &result }, output_types, in_width));
1250 const std::vector<std::shared_ptr<const rvsdg::
Type>> & load_types,
1251 const std::vector<std::shared_ptr<const rvsdg::
Type>> & store_types)
1253 CreateInTypes(load_types, store_types),
1254 CreateOutTypes(load_types, store_types))
1256 for (
auto loadType : load_types)
1258 LoadTypes_.emplace_back(loadType);
1260 for (
auto storeType : store_types)
1262 StoreTypes_.emplace_back(storeType);
1273 return ot && ot->
narguments() == narguments()
1274 && (ot->narguments() == 0 || (*ot->argument(1) == *argument(1)))
1275 && ot->narguments() == narguments();
1278 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1280 const std::vector<std::shared_ptr<const rvsdg::Type>> & load_types,
1281 const std::vector<std::shared_ptr<const rvsdg::Type>> & store_types)
1283 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types;
1284 for (
size_t i = 0; i < load_types.size(); i++)
1288 for (
auto storeType : store_types)
1291 types.emplace_back(storeType);
1296 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1298 const std::vector<std::shared_ptr<const rvsdg::Type>> & load_types,
1299 const std::vector<std::shared_ptr<const rvsdg::Type>> & store_types)
1302 for (
auto tp : load_types)
1305 max_width = sz > max_width ? sz : max_width;
1307 for (
auto tp : store_types)
1310 max_width = sz > max_width ? sz : max_width;
1312 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types;
1321 return "HLS_MEM_REQ";
1324 [[nodiscard]] std::unique_ptr<Operation>
1327 return std::make_unique<MemoryRequestOperation>(*
this);
1330 static std::vector<jlm::rvsdg::Output *>
1332 const std::vector<jlm::rvsdg::Output *> & load_operands,
1333 const std::vector<std::shared_ptr<const rvsdg::Type>> & loadTypes,
1334 const std::vector<jlm::rvsdg::Output *> & store_operands,
1340 std::vector<std::shared_ptr<const rvsdg::Type>> storeTypes;
1341 for (
size_t i = 1; i < store_operands.size(); i += 2)
1343 storeTypes.push_back(store_operands[i]->
Type());
1345 std::vector
operands(load_operands);
1346 operands.insert(
operands.end(), store_operands.begin(), store_operands.end());
1347 return outputs(&rvsdg::CreateOpNode<MemoryRequestOperation>(
operands, loadTypes, storeTypes));
1353 return LoadTypes_.size();
1356 const std::vector<std::shared_ptr<const rvsdg::Type>> *
1362 const std::vector<std::shared_ptr<const rvsdg::Type>> *
1365 return &StoreTypes_;
1380 CreateInTypes(pointeeType, numStates),
1381 CreateOutTypes(pointeeType, numStates))
1389 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1392 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1393 CreateInTypes(
const std::shared_ptr<const rvsdg::Type> & pointeeType,
size_t numStates)
1395 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(
1397 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> states(
1400 types.insert(types.end(), states.begin(), states.end());
1404 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1405 CreateOutTypes(
const std::shared_ptr<const rvsdg::Type> & pointeeType,
size_t numStates)
1407 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(
1411 types.emplace_back(pointeeType);
1418 return "HLS_STORE_" + argument(narguments() - 1)->debug_string();
1421 [[nodiscard]] std::unique_ptr<Operation>
1424 return std::make_unique<StoreOperation>(*
this);
1427 static std::vector<jlm::rvsdg::Output *>
1431 const std::vector<jlm::rvsdg::Output *> & states,
1434 std::vector<jlm::rvsdg::Output *> inputs;
1435 inputs.push_back(&addr);
1436 inputs.push_back(&value);
1437 inputs.insert(inputs.end(), states.begin(), states.end());
1438 inputs.push_back(&resp);
1439 return outputs(&rvsdg::CreateOpNode<StoreOperation>(inputs, value.
Type(), states.size()));
1445 return *util::assertedCast<const llvm::PointerType>(argument(0).get());
1451 return *argument(1).get();
1470 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1473 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(2, std::move(at));
1480 return "HLS_LOCAL_MEM_" + result(0)->debug_string();
1483 [[nodiscard]] std::unique_ptr<Operation>
1486 return std::make_unique<LocalMemoryOperation>(*
this);
1489 static std::vector<jlm::rvsdg::Output *>
1492 return outputs(&rvsdg::CreateOpNode<LocalMemoryOperation>(*region, std::move(at)));
1510 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1513 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1514 CreateOutTypes(
const std::shared_ptr<const jlm::llvm::ArrayType> & at,
size_t resp_count)
1516 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(resp_count, at->GetElementType());
1523 return "HLS_LOCAL_MEM_RESP";
1526 [[nodiscard]] std::unique_ptr<Operation>
1529 return std::make_unique<LocalMemoryResponseOperation>(*
this);
1532 static std::vector<jlm::rvsdg::Output *>
1535 return outputs(&rvsdg::CreateOpNode<LocalMemoryResponseOperation>(
1537 std::dynamic_pointer_cast<const llvm::ArrayType>(mem.
Type()),
1548 :
SimpleOperation(CreateInTypes(valuetype, numStates), CreateOutTypes(valuetype, numStates))
1556 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1559 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1560 CreateInTypes(
const std::shared_ptr<const jlm::rvsdg::Type> & valuetype,
size_t numStates)
1563 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> states(
1566 types.insert(types.end(), states.begin(), states.end());
1567 types.emplace_back(valuetype);
1571 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1572 CreateOutTypes(
const std::shared_ptr<const jlm::rvsdg::Type> & valuetype,
size_t numStates)
1574 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(1, valuetype);
1575 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> states(
1578 types.insert(types.end(), states.begin(), states.end());
1586 return "HLS_LOCAL_LOAD_" + argument(narguments() - 1)->debug_string();
1589 [[nodiscard]] std::unique_ptr<Operation>
1592 return std::make_unique<LocalLoadOperation>(*
this);
1595 static std::vector<jlm::rvsdg::Output *>
1598 const std::vector<jlm::rvsdg::Output *> & states,
1601 std::vector<jlm::rvsdg::Output *> inputs;
1602 inputs.push_back(&index);
1603 inputs.insert(inputs.end(), states.begin(), states.end());
1604 inputs.push_back(&load_result);
1606 &rvsdg::CreateOpNode<LocalLoadOperation>(inputs, load_result.
Type(), states.size()));
1609 [[nodiscard]] std::shared_ptr<const rvsdg::Type>
1622 :
SimpleOperation(CreateInTypes(valuetype, numStates), CreateOutTypes(valuetype, numStates))
1630 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1633 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1634 CreateInTypes(
const std::shared_ptr<const jlm::rvsdg::Type> & valuetype,
size_t numStates)
1636 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(
1638 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> states(
1641 types.insert(types.end(), states.begin(), states.end());
1645 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1646 CreateOutTypes(
const std::shared_ptr<const jlm::rvsdg::Type> & valuetype,
size_t numStates)
1648 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(
1652 types.emplace_back(valuetype);
1659 return "HLS_LOCAL_STORE_" + argument(narguments() - 1)->debug_string();
1662 [[nodiscard]] std::unique_ptr<Operation>
1665 return std::make_unique<LocalStoreOperation>(*
this);
1668 static std::vector<jlm::rvsdg::Output *>
1672 const std::vector<jlm::rvsdg::Output *> & states)
1674 std::vector<jlm::rvsdg::Output *> inputs;
1675 inputs.push_back(&index);
1676 inputs.push_back(&value);
1677 inputs.insert(inputs.end(), states.begin(), states.end());
1678 return outputs(&rvsdg::CreateOpNode<LocalStoreOperation>(inputs, value.
Type(), states.size()));
1684 return *argument(1).get();
1705 return ot && ot->
narguments() == narguments()
1706 && (ot->narguments() == 0 || (*ot->argument(1) == *argument(1)))
1707 && ot->narguments() == narguments();
1710 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1712 const std::shared_ptr<const llvm::ArrayType> & at,
1716 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(1, at);
1717 for (
size_t i = 0; i < load_cnt; ++i)
1721 for (
size_t i = 0; i < store_cnt; ++i)
1724 types.emplace_back(at->GetElementType());
1732 return "HLS_LOCAL_MEM_REQ";
1735 [[nodiscard]] std::unique_ptr<Operation>
1738 return std::make_unique<LocalMemoryRequestOperation>(*
this);
1741 static std::vector<jlm::rvsdg::Output *>
1744 const std::vector<jlm::rvsdg::Output *> & load_operands,
1745 const std::vector<jlm::rvsdg::Output *> & store_operands)
1749 operands.insert(
operands.end(), load_operands.begin(), load_operands.end());
1750 operands.insert(
operands.end(), store_operands.begin(), store_operands.end());
1751 return outputs(&rvsdg::CreateOpNode<LocalMemoryRequestOperation>(
1753 std::dynamic_pointer_cast<const llvm::ArrayType>(mem.
Type()),
1754 load_operands.size(),
1755 store_operands.size() / 2));
std::unique_ptr< Operation > copy() const override
bool operator==(const Operation &other) const noexcept override
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateOutTypes(std::shared_ptr< const llvm::PointerType > pointerType)
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateInTypes(std::shared_ptr< const llvm::PointerType > pointerType)
~AddressQueueOperation() noexcept override
static jlm::rvsdg::Output * create(jlm::rvsdg::Output &check, jlm::rvsdg::Output &enq, jlm::rvsdg::Output &deq, bool combinatorial, size_t capacity=10)
std::string debug_string() const override
~BackEdgeArgument() noexcept override=default
BackEdgeArgument(rvsdg::Region *region, const std::shared_ptr< const jlm::rvsdg::Type > &type)
static BackEdgeArgument & create(rvsdg::Region *region, std::shared_ptr< const jlm::rvsdg::Type > type)
BackEdgeResult(rvsdg::Output *origin)
~BackEdgeResult() override=default
BackEdgeArgument * argument_
static BackEdgeResult & create(jlm::rvsdg::Output *origin)
BackEdgeArgument * argument() const
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
~BranchOperation() noexcept override
bool operator==(const Operation &other) const noexcept override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &predicate, jlm::rvsdg::Output &value, bool loop=false)
~BufferOperation() noexcept override
bool operator==(const Operation &other) const noexcept override
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
std::size_t Capacity() const noexcept
bool IsPassThrough() const noexcept
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &value, size_t capacity, bool pass_through=false)
std::string debug_string() const override
BundleType(const BundleType &)=default
const std::vector< std::pair< std::string, std::shared_ptr< const jlm::rvsdg::Type > > > elements_
~BundleType() noexcept override
BundleType(BundleType &&)=delete
bool operator==(const jlm::rvsdg::Type &other) const noexcept override
BundleType & operator=(const BundleType &)=delete
BundleType & operator=(BundleType &&)=delete
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateInTypes(std::shared_ptr< const rvsdg::Type > pointeeType)
~DecoupledLoadOperation() noexcept override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &addr, jlm::rvsdg::Output &load_result, size_t capacity)
std::string debug_string() const override
std::shared_ptr< const rvsdg::Type > GetLoadedType() const noexcept
bool operator==(const Operation &other) const noexcept override
std::unique_ptr< Operation > copy() const override
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateOutTypes(std::shared_ptr< const rvsdg::Type > pointeeType)
const llvm::PointerType & GetPointerType() const noexcept
~EntryArgument() noexcept override
EntryArgument(rvsdg::Region ®ion, rvsdg::StructuralInput &input, const std::shared_ptr< const rvsdg::Type > type)
~ExitResult() noexcept override
ForkOperation(size_t nalternatives, const std::shared_ptr< const jlm::rvsdg::Type > &type, bool isConstant)
static std::vector< jlm::rvsdg::Output * > create(size_t nalternatives, jlm::rvsdg::Output &value, bool isConstant=false)
static rvsdg::Node & CreateNode(const size_t numResults, rvsdg::Output &operand, const bool isConstant=false)
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
bool operator==(const Operation &other) const noexcept override
~ForkOperation() noexcept override
bool IsConstant() const noexcept
std::unique_ptr< Operation > copy() const override
const llvm::PointerType & GetPointerType() const noexcept
bool operator==(const Operation &other) const noexcept override
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateInTypes(std::shared_ptr< const rvsdg::Type > pointeeType, size_t numStates)
std::shared_ptr< const rvsdg::Type > GetLoadedType() const noexcept
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &addr, const std::vector< jlm::rvsdg::Output * > &states, jlm::rvsdg::Output &load_result)
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateOutTypes(std::shared_ptr< const rvsdg::Type > pointeeType, size_t numStates)
~LoadOperation() noexcept override
std::string debug_string() const override
bool operator==(const Operation &other) const noexcept override
std::unique_ptr< Operation > copy() const override
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateInTypes(const std::shared_ptr< const jlm::rvsdg::Type > &valuetype, size_t numStates)
std::shared_ptr< const rvsdg::Type > GetLoadedType() const noexcept
std::string debug_string() const override
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateOutTypes(const std::shared_ptr< const jlm::rvsdg::Type > &valuetype, size_t numStates)
~LocalLoadOperation() noexcept override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &index, const std::vector< jlm::rvsdg::Output * > &states, jlm::rvsdg::Output &load_result)
bool operator==(const Operation &) const noexcept override
static std::vector< jlm::rvsdg::Output * > create(std::shared_ptr< const llvm::ArrayType > at, rvsdg::Region *region)
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateOutTypes(std::shared_ptr< const llvm::ArrayType > at)
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
~LocalMemoryOperation() noexcept override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &mem, const std::vector< jlm::rvsdg::Output * > &load_operands, const std::vector< jlm::rvsdg::Output * > &store_operands)
~LocalMemoryRequestOperation() noexcept override
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
bool operator==(const Operation &other) const noexcept override
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateInTypes(const std::shared_ptr< const llvm::ArrayType > &at, size_t load_cnt, size_t store_cnt)
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &mem, size_t resp_count)
bool operator==(const Operation &other) const noexcept override
~LocalMemoryResponseOperation() noexcept override
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateOutTypes(const std::shared_ptr< const jlm::llvm::ArrayType > &at, size_t resp_count)
~LocalStoreOperation() noexcept override
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateInTypes(const std::shared_ptr< const jlm::rvsdg::Type > &valuetype, size_t numStates)
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &index, jlm::rvsdg::Output &value, const std::vector< jlm::rvsdg::Output * > &states)
bool operator==(const Operation &other) const noexcept override
const jlm::rvsdg::Type & GetStoredType() const noexcept
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateOutTypes(const std::shared_ptr< const jlm::rvsdg::Type > &valuetype, size_t numStates)
std::string debug_string() const override
bool operator==(const Operation &other) const noexcept override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &predicate, jlm::rvsdg::Output &value)
~LoopConstantBufferOperation() noexcept override
std::unique_ptr< Operation > copy() const override
rvsdg::Output & GetPredicateBuffer() const noexcept
rvsdg::RegionResult * predicate() const noexcept
~LoopNode() noexcept override=default
std::unique_ptr< Operation > copy() const override
~LoopOperation() noexcept override
std::unique_ptr< Operation > copy() const override
~MemoryRequestOperation() noexcept override=default
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateInTypes(const std::vector< std::shared_ptr< const rvsdg::Type >> &load_types, const std::vector< std::shared_ptr< const rvsdg::Type >> &store_types)
size_t get_nloads() const
bool operator==(const Operation &other) const noexcept override
MemoryRequestOperation(const MemoryRequestOperation &other)=default
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateOutTypes(const std::vector< std::shared_ptr< const rvsdg::Type >> &load_types, const std::vector< std::shared_ptr< const rvsdg::Type >> &store_types)
std::vector< std::shared_ptr< const rvsdg::Type > > LoadTypes_
std::string debug_string() const override
std::vector< std::shared_ptr< const rvsdg::Type > > StoreTypes_
static std::vector< jlm::rvsdg::Output * > create(const std::vector< jlm::rvsdg::Output * > &load_operands, const std::vector< std::shared_ptr< const rvsdg::Type >> &loadTypes, const std::vector< jlm::rvsdg::Output * > &store_operands, rvsdg::Region *)
const std::vector< std::shared_ptr< const rvsdg::Type > > * GetStoreTypes() const
const std::vector< std::shared_ptr< const rvsdg::Type > > * GetLoadTypes() const
static std::vector< jlm::rvsdg::Output * > create(rvsdg::Output &result, const std::vector< std::shared_ptr< const rvsdg::Type >> &output_types, int in_width)
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateInTypes(int in_width)
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateOutTypes(const std::vector< std::shared_ptr< const rvsdg::Type >> &output_types)
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
~MemoryResponseOperation() noexcept override
bool operator==(const Operation &other) const noexcept override
~MuxOperation() noexcept override
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &predicate, const std::vector< jlm::rvsdg::Output * > &alternatives, bool discarding, bool loop=false)
bool operator==(const Operation &other) const noexcept override
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > create_typevector(size_t nalternatives, std::shared_ptr< const jlm::rvsdg::Type > type)
~PredicateBufferOperation() noexcept override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &predicate)
std::unique_ptr< Operation > copy() const override
bool operator==(const Operation &other) const noexcept override
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
bool operator==(const Operation &) const noexcept override
~PrintOperation() noexcept override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &value)
std::string debug_string() const override
~SinkOperation() noexcept override
bool operator==(const Operation &other) const noexcept override
std::unique_ptr< Operation > copy() const override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &value)
std::string debug_string() const override
bool operator==(const Operation &other) const noexcept override
~StateGateOperation() noexcept override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &addr, const std::vector< jlm::rvsdg::Output * > &states)
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateInOutTypes(const std::shared_ptr< const jlm::rvsdg::Type > &type, size_t numStates)
~StoreOperation() noexcept override
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateOutTypes(const std::shared_ptr< const rvsdg::Type > &pointeeType, size_t numStates)
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &addr, jlm::rvsdg::Output &value, const std::vector< jlm::rvsdg::Output * > &states, jlm::rvsdg::Output &resp)
bool operator==(const Operation &other) const noexcept override
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateInTypes(const std::shared_ptr< const rvsdg::Type > &pointeeType, size_t numStates)
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
const llvm::PointerType & GetPointerType() const noexcept
const rvsdg::Type & GetStoredType() const noexcept
bool operator==(const Operation &other) const noexcept override
std::string debug_string() const override
~TriggerOperation() noexcept override
std::unique_ptr< Operation > copy() const override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &tg, jlm::rvsdg::Output &value)
std::size_t ComputeHash() const noexcept override
rvsdg::TypeKind Kind() const noexcept override
Return the kind of this type.
static std::shared_ptr< const TriggerType > Create()
std::string debug_string() const override
~TriggerType() noexcept override
bool operator==(const Type &other) const noexcept override
static std::shared_ptr< const MemoryStateType > Create()
static std::shared_ptr< const PointerType > Create()
static std::shared_ptr< const BitType > Create(std::size_t nbits)
Creates bit type of specified width.
static std::shared_ptr< const ControlType > Create(std::size_t nalternatives)
Instantiates control type.
rvsdg::Region * region() const noexcept
const std::shared_ptr< const rvsdg::Type > & Type() const noexcept
Represents the argument of a region.
Represents the result of a region.
Represent acyclic RVSDG subgraphs.
RegionArgument & addArgument(std::unique_ptr< RegionArgument > argument)
RegionResult & addResult(std::unique_ptr< RegionResult > result)
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 nresults() const noexcept
size_t narguments() const noexcept
rvsdg::Region * subregion(size_t index) const noexcept
constexpr Type() noexcept
std::shared_ptr< const BundleType > get_mem_res_type(std::shared_ptr< const jlm::rvsdg::Type > dataType)
std::shared_ptr< const BundleType > get_mem_req_type(std::shared_ptr< const rvsdg::Type > elementType, bool write)
int JlmSize(const jlm::rvsdg::Type *type)
size_t GetPointerSizeInBits()
static std::string type(const Node *n)
TypeKind
The kinds of types supported in rvsdg.
static std::vector< jlm::rvsdg::Output * > operands(const Node *node)
static std::vector< jlm::rvsdg::Output * > outputs(const Node *node)
static std::string strfmt(Args... args)