6#ifndef JLM_HLS_IR_HLS_HPP
7#define JLM_HLS_IR_HLS_HPP
42 { nalternatives, type }),
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.");
75 { &predicate, &value },
119 size_t nalternatives,
120 const std::shared_ptr<const jlm::rvsdg::Type> & type,
142 return IsConstant() ?
"HLS_CFORK" :
"HLS_FORK";
148 return std::make_unique<ForkOperation>(*
this);
160 static std::vector<jlm::rvsdg::Output *>
204 size_t nalternatives,
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 *>();
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));
298 return std::make_unique<SinkOperation>(*
this);
301 static std::vector<jlm::rvsdg::Output *>
327 return "HLS_PRED_BUF";
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.");
368 return "HLS_LOOP_CONST_BUF";
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.");
385 { &predicate, &value },
434 return std::make_unique<BufferOperation>(*
this);
437 static std::vector<jlm::rvsdg::Output *>
492 return ot && *
ot->
argument(1) == *argument(1) && *
ot->result(0) == *result(0);
498 return "HLS_TRIGGER";
504 return std::make_unique<TriggerOperation>(*
this);
507 static std::vector<jlm::rvsdg::Output *>
511 throw util::Error(
"Trigger needs to be a TriggerType.");
527 static size_t common_id{ 0 };
541 return util::strfmt(
"HLS_PRINT_", _id);
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()));
569 debug_string()
const override
574 [[nodiscard]] std::unique_ptr<Operation>
577 return std::make_unique<LoopOperation>(*
this);
581class BackEdgeArgument;
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)));
643 std::unique_ptr<BackEdgeArgument> argument(
new BackEdgeArgument(region, std::move(type)));
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)));
764 GetOperation() const noexcept override;
767 mapInput(const rvsdg::
Input & input);
770 mapOutput(const rvsdg::
Output & output);
773 mapArgument(const rvsdg::
Output & argument);
776 mapResult(const rvsdg::
Input & result);
788 removeEntryVars(std::vector<
EntryVar> vars);
791 removeExitVars(std::vector<
ExitVar> vars);
797 create(rvsdg::
Region * parent);
800 subregion() const noexcept
802 return StructuralNode::subregion(0);
808 auto result = subregion()->result(0);
809 JLM_ASSERT(rvsdg::is<const rvsdg::ControlType>(result->Type()));
816 return *PredicateBuffer_;
823 add_backedge(std::shared_ptr<const jlm::rvsdg::Type> type);
889 const std::vector<std::pair<std::
string, std::shared_ptr<const
Type>>> elements)
890 : elements_(std::move(elements))
906 auto type =
dynamic_cast<const BundleType *
>(&other);
908 if (!type || type->elements_.size() != elements_.size())
912 for (
size_t i = 0; i < elements_.size(); ++i)
914 if (type->elements_.at(i).first != elements_.at(i).first
915 || *type->elements_.at(i).second != *elements_.at(i).second)
923 [[nodiscard]] std::size_t
924 ComputeHash() const noexcept override;
927 Kind() const noexcept override;
929 std::shared_ptr<const
jlm::rvsdg::
Type>
930 get_element_type(std::
string element)
const
932 for (
size_t i = 0; i < elements_.size(); ++i)
934 if (elements_.at(i).first == element)
936 return elements_.at(i).second;
943 [[nodiscard]] std::string
951 const std::vector<std::pair<std::string, std::shared_ptr<const jlm::rvsdg::Type>>>
elements_;
954std::shared_ptr<const BundleType>
957std::shared_ptr<const BundleType>
967 CreateInTypes(pointeeType, numStates),
968 CreateOutTypes(pointeeType, numStates))
976 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
979 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
980 CreateInTypes(std::shared_ptr<const rvsdg::Type> pointeeType,
size_t numStates)
982 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(
984 llvm::PointerType::Create());
985 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> states(
987 llvm::MemoryStateType::Create());
988 types.insert(types.end(), states.begin(), states.end());
989 types.emplace_back(std::move(pointeeType));
993 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
996 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(1, std::move(pointeeType));
997 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> states(
999 llvm::MemoryStateType::Create());
1000 types.insert(types.end(), states.begin(), states.end());
1001 types.emplace_back(llvm::PointerType::Create());
1008 return "HLS_LOAD_" + argument(narguments() - 1)->debug_string();
1011 [[nodiscard]] std::unique_ptr<Operation>
1014 return std::make_unique<LoadOperation>(*
this);
1017 static std::vector<jlm::rvsdg::Output *>
1020 const std::vector<jlm::rvsdg::Output *> & states,
1023 std::vector<jlm::rvsdg::Output *> inputs;
1024 inputs.push_back(&addr);
1025 inputs.insert(inputs.end(), states.begin(), states.end());
1026 inputs.push_back(&load_result);
1027 return outputs(&rvsdg::CreateOpNode<LoadOperation>(inputs, load_result.
Type(), states.size()));
1033 return *util::assertedCast<const llvm::PointerType>(argument(0).get());
1036 [[nodiscard]] std::shared_ptr<const rvsdg::Type>
1052 :
SimpleOperation(CreateInTypes(pointerType), CreateOutTypes(pointerType)),
1053 combinatorial(combinatorial),
1062 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1065 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1069 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(2, std::move(pointerType));
1070 types.emplace_back(llvm::MemoryStateType::Create());
1074 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1077 return { std::move(pointerType) };
1085 return "HLS_ADDR_QUEUE_COMB_" + argument(narguments() - 1)->debug_string();
1087 return "HLS_ADDR_QUEUE_" + argument(narguments() - 1)->debug_string();
1090 [[nodiscard]] std::unique_ptr<Operation>
1093 return std::make_unique<AddressQueueOperation>(*
this);
1102 size_t capacity = 10)
1104 return rvsdg::CreateOpNode<AddressQueueOperation>(
1105 { &
check, &enq, &deq },
1106 std::dynamic_pointer_cast<const llvm::PointerType>(
check.Type()),
1122 :
SimpleOperation(CreateInOutTypes(type, numStates), CreateInOutTypes(type, numStates))
1130 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1133 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1136 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(1, type);
1137 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> states(
1139 llvm::MemoryStateType::Create());
1140 types.insert(types.end(), states.begin(), states.end());
1147 return "HLS_STATE_GATE_" + argument(narguments() - 1)->debug_string();
1150 [[nodiscard]] std::unique_ptr<Operation>
1153 return std::make_unique<StateGateOperation>(*
this);
1156 static std::vector<jlm::rvsdg::Output *>
1159 std::vector<jlm::rvsdg::Output *> inputs;
1160 inputs.push_back(&addr);
1161 inputs.insert(inputs.end(), states.begin(), states.end());
1162 return outputs(&rvsdg::CreateOpNode<StateGateOperation>(inputs, addr.
Type(), states.size()));
1172 :
SimpleOperation(CreateInTypes(pointeeType), CreateOutTypes(pointeeType)),
1181 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1184 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1187 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types = {
1188 llvm::PointerType::Create(),
1194 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1197 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types = {
1199 llvm::PointerType::Create()
1207 return "HLS_DEC_LOAD_" + std::to_string(capacity) +
"_"
1208 + argument(narguments() - 1)->debug_string();
1211 [[nodiscard]] std::unique_ptr<Operation>
1214 return std::make_unique<DecoupledLoadOperation>(*
this);
1217 static std::vector<jlm::rvsdg::Output *>
1220 std::vector<jlm::rvsdg::Output *> inputs;
1221 inputs.push_back(&addr);
1222 inputs.push_back(&load_result);
1225 &rvsdg::CreateOpNode<DecoupledLoadOperation>(inputs, load_result.
Type(), capacity));
1231 return *util::assertedCast<const llvm::PointerType>(argument(0).get());
1234 [[nodiscard]] std::shared_ptr<const rvsdg::Type>
1249 const std::vector<std::shared_ptr<const rvsdg::
Type>> & output_types,
1251 :
SimpleOperation(CreateInTypes(in_width), CreateOutTypes(output_types))
1259 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1262 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1265 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types;
1270 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1273 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types;
1274 types.reserve(output_types.size());
1275 for (
auto outputType : output_types)
1277 types.emplace_back(outputType);
1285 return "HLS_MEM_RESP";
1288 [[nodiscard]] std::unique_ptr<Operation>
1291 return std::make_unique<MemoryResponseOperation>(*
this);
1294 static std::vector<jlm::rvsdg::Output *>
1297 const std::vector<std::shared_ptr<const rvsdg::Type>> & output_types,
1301 &rvsdg::CreateOpNode<MemoryResponseOperation>({ &result }, output_types, in_width));
1311 const std::vector<std::shared_ptr<const rvsdg::
Type>> & load_types,
1312 const std::vector<std::shared_ptr<const rvsdg::
Type>> & store_types)
1314 CreateInTypes(load_types, store_types),
1315 CreateOutTypes(load_types, store_types))
1317 for (
auto loadType : load_types)
1319 LoadTypes_.emplace_back(loadType);
1321 for (
auto storeType : store_types)
1323 StoreTypes_.emplace_back(storeType);
1334 return ot && ot->
narguments() == narguments()
1335 && (ot->narguments() == 0 || (*ot->argument(1) == *argument(1)))
1336 && ot->narguments() == narguments();
1339 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1341 const std::vector<std::shared_ptr<const rvsdg::Type>> & load_types,
1342 const std::vector<std::shared_ptr<const rvsdg::Type>> & store_types)
1344 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types;
1345 for (
size_t i = 0; i < load_types.size(); i++)
1347 types.emplace_back(llvm::PointerType::Create());
1349 for (
auto storeType : store_types)
1351 types.emplace_back(llvm::PointerType::Create());
1352 types.emplace_back(storeType);
1357 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1359 const std::vector<std::shared_ptr<const rvsdg::Type>> & load_types,
1360 const std::vector<std::shared_ptr<const rvsdg::Type>> & store_types)
1363 for (
auto tp : load_types)
1366 max_width = sz > max_width ? sz : max_width;
1368 for (
auto tp : store_types)
1371 max_width = sz > max_width ? sz : max_width;
1373 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types;
1382 return "HLS_MEM_REQ";
1385 [[nodiscard]] std::unique_ptr<Operation>
1388 return std::make_unique<MemoryRequestOperation>(*
this);
1391 static std::vector<jlm::rvsdg::Output *>
1393 const std::vector<jlm::rvsdg::Output *> & load_operands,
1394 const std::vector<std::shared_ptr<const rvsdg::Type>> & loadTypes,
1395 const std::vector<jlm::rvsdg::Output *> & store_operands,
1401 std::vector<std::shared_ptr<const rvsdg::Type>> storeTypes;
1402 for (
size_t i = 1; i < store_operands.size(); i += 2)
1404 storeTypes.push_back(store_operands[i]->
Type());
1406 std::vector operands(load_operands);
1407 operands.insert(operands.end(), store_operands.begin(), store_operands.end());
1408 return outputs(&rvsdg::CreateOpNode<MemoryRequestOperation>(operands, loadTypes, storeTypes));
1414 return LoadTypes_.size();
1417 const std::vector<std::shared_ptr<const rvsdg::Type>> *
1423 const std::vector<std::shared_ptr<const rvsdg::Type>> *
1426 return &StoreTypes_;
1441 CreateInTypes(pointeeType, numStates),
1442 CreateOutTypes(pointeeType, numStates))
1450 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1453 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1454 CreateInTypes(
const std::shared_ptr<const rvsdg::Type> & pointeeType,
size_t numStates)
1456 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(
1457 { llvm::PointerType::Create(), pointeeType });
1458 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> states(
1460 llvm::MemoryStateType::Create());
1461 types.insert(types.end(), states.begin(), states.end());
1465 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1466 CreateOutTypes(
const std::shared_ptr<const rvsdg::Type> & pointeeType,
size_t numStates)
1468 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(
1470 llvm::MemoryStateType::Create());
1471 types.emplace_back(llvm::PointerType::Create());
1472 types.emplace_back(pointeeType);
1479 return "HLS_STORE_" + argument(narguments() - 1)->debug_string();
1482 [[nodiscard]] std::unique_ptr<Operation>
1485 return std::make_unique<StoreOperation>(*
this);
1488 static std::vector<jlm::rvsdg::Output *>
1492 const std::vector<jlm::rvsdg::Output *> & states,
1495 std::vector<jlm::rvsdg::Output *> inputs;
1496 inputs.push_back(&addr);
1497 inputs.push_back(&value);
1498 inputs.insert(inputs.end(), states.begin(), states.end());
1499 inputs.push_back(&resp);
1500 return outputs(&rvsdg::CreateOpNode<StoreOperation>(inputs, value.
Type(), states.size()));
1506 return *util::assertedCast<const llvm::PointerType>(argument(0).get());
1512 return *argument(1).get();
1531 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1534 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(2, std::move(at));
1541 return "HLS_LOCAL_MEM_" + result(0)->debug_string();
1544 [[nodiscard]] std::unique_ptr<Operation>
1547 return std::make_unique<LocalMemoryOperation>(*
this);
1550 static std::vector<jlm::rvsdg::Output *>
1553 return outputs(&rvsdg::CreateOpNode<LocalMemoryOperation>(*region, std::move(at)));
1571 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1574 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1575 CreateOutTypes(
const std::shared_ptr<const jlm::llvm::ArrayType> & at,
size_t resp_count)
1577 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(resp_count, at->GetElementType());
1584 return "HLS_LOCAL_MEM_RESP";
1587 [[nodiscard]] std::unique_ptr<Operation>
1590 return std::make_unique<LocalMemoryResponseOperation>(*
this);
1593 static std::vector<jlm::rvsdg::Output *>
1596 return outputs(&rvsdg::CreateOpNode<LocalMemoryResponseOperation>(
1598 std::dynamic_pointer_cast<const llvm::ArrayType>(mem.
Type()),
1609 :
SimpleOperation(CreateInTypes(valuetype, numStates), CreateOutTypes(valuetype, numStates))
1617 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1620 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1621 CreateInTypes(
const std::shared_ptr<const jlm::rvsdg::Type> & valuetype,
size_t numStates)
1624 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> states(
1626 llvm::MemoryStateType::Create());
1627 types.insert(types.end(), states.begin(), states.end());
1628 types.emplace_back(valuetype);
1632 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1633 CreateOutTypes(
const std::shared_ptr<const jlm::rvsdg::Type> & valuetype,
size_t numStates)
1635 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(1, valuetype);
1636 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> states(
1638 llvm::MemoryStateType::Create());
1639 types.insert(types.end(), states.begin(), states.end());
1647 return "HLS_LOCAL_LOAD_" + argument(narguments() - 1)->debug_string();
1650 [[nodiscard]] std::unique_ptr<Operation>
1653 return std::make_unique<LocalLoadOperation>(*
this);
1656 static std::vector<jlm::rvsdg::Output *>
1659 const std::vector<jlm::rvsdg::Output *> & states,
1662 std::vector<jlm::rvsdg::Output *> inputs;
1663 inputs.push_back(&index);
1664 inputs.insert(inputs.end(), states.begin(), states.end());
1665 inputs.push_back(&load_result);
1667 &rvsdg::CreateOpNode<LocalLoadOperation>(inputs, load_result.
Type(), states.size()));
1670 [[nodiscard]] std::shared_ptr<const rvsdg::Type>
1683 :
SimpleOperation(CreateInTypes(valuetype, numStates), CreateOutTypes(valuetype, numStates))
1691 return ot && *ot->
argument(1) == *argument(1) && ot->narguments() == narguments();
1694 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1695 CreateInTypes(
const std::shared_ptr<const jlm::rvsdg::Type> & valuetype,
size_t numStates)
1697 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(
1699 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> states(
1701 llvm::MemoryStateType::Create());
1702 types.insert(types.end(), states.begin(), states.end());
1706 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1707 CreateOutTypes(
const std::shared_ptr<const jlm::rvsdg::Type> & valuetype,
size_t numStates)
1709 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(
1711 llvm::MemoryStateType::Create());
1713 types.emplace_back(valuetype);
1720 return "HLS_LOCAL_STORE_" + argument(narguments() - 1)->debug_string();
1723 [[nodiscard]] std::unique_ptr<Operation>
1726 return std::make_unique<LocalStoreOperation>(*
this);
1729 static std::vector<jlm::rvsdg::Output *>
1733 const std::vector<jlm::rvsdg::Output *> & states)
1735 std::vector<jlm::rvsdg::Output *> inputs;
1736 inputs.push_back(&index);
1737 inputs.push_back(&value);
1738 inputs.insert(inputs.end(), states.begin(), states.end());
1739 return outputs(&rvsdg::CreateOpNode<LocalStoreOperation>(inputs, value.
Type(), states.size()));
1745 return *argument(1).get();
1766 return ot && ot->
narguments() == narguments()
1767 && (ot->narguments() == 0 || (*ot->argument(1) == *argument(1)))
1768 && ot->narguments() == narguments();
1771 static std::vector<std::shared_ptr<const jlm::rvsdg::Type>>
1773 const std::shared_ptr<const llvm::ArrayType> & at,
1777 std::vector<std::shared_ptr<const jlm::rvsdg::Type>> types(1, at);
1778 for (
size_t i = 0; i < load_cnt; ++i)
1782 for (
size_t i = 0; i < store_cnt; ++i)
1785 types.emplace_back(at->GetElementType());
1793 return "HLS_LOCAL_MEM_REQ";
1796 [[nodiscard]] std::unique_ptr<Operation>
1799 return std::make_unique<LocalMemoryRequestOperation>(*
this);
1802 static std::vector<jlm::rvsdg::Output *>
1805 const std::vector<jlm::rvsdg::Output *> & load_operands,
1806 const std::vector<jlm::rvsdg::Output *> & store_operands)
1809 std::vector operands(1, &mem);
1810 operands.insert(operands.end(), load_operands.begin(), load_operands.end());
1811 operands.insert(operands.end(), store_operands.begin(), store_operands.end());
1812 return outputs(&rvsdg::CreateOpNode<LocalMemoryRequestOperation>(
1814 std::dynamic_pointer_cast<const llvm::ArrayType>(mem.
Type()),
1815 load_operands.size(),
1816 store_operands.size() / 2));
static void check(const jlm::llvm::DominatorTreeNode *dnode, const jlm::llvm::ControlFlowGraphNode *node, const std::unordered_set< const jlm::llvm::ControlFlowGraphNode * > &children)
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)
std::unique_ptr< Operation > copy() const override
~AddressQueueOperation() noexcept override
std::string debug_string() const override
static jlm::rvsdg::Output * create(jlm::rvsdg::Output &check, jlm::rvsdg::Output &enq, jlm::rvsdg::Output &deq, bool combinatorial, size_t capacity=10)
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateInTypes(std::shared_ptr< const llvm::PointerType > pointerType)
~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_
BackEdgeArgument * argument() const
static BackEdgeResult & create(jlm::rvsdg::Output *origin)
std::unique_ptr< Operation > copy() const override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &predicate, jlm::rvsdg::Output &value, bool loop=false)
std::string debug_string() const override
~BranchOperation() noexcept override
bool operator==(const Operation &other) const noexcept override
~BufferOperation() noexcept override
bool operator==(const Operation &other) const noexcept override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &value, size_t capacity, bool pass_through=false)
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
std::size_t Capacity() const noexcept
bool IsPassThrough() const noexcept
BundleType & operator=(BundleType &&)=delete
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 & operator=(const BundleType &)=delete
BundleType(BundleType &&)=delete
bool operator==(const jlm::rvsdg::Type &other) const noexcept override
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
bool operator==(const Operation &other) const noexcept override
std::unique_ptr< Operation > copy() const override
std::shared_ptr< const rvsdg::Type > GetLoadedType() const noexcept
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)
std::unique_ptr< Operation > copy() const override
static rvsdg::Node & CreateNode(const size_t numResults, rvsdg::Output &operand, const bool isConstant=false)
std::string debug_string() const override
bool operator==(const Operation &other) const noexcept override
~ForkOperation() noexcept override
bool IsConstant() const noexcept
std::shared_ptr< const rvsdg::Type > GetLoadedType() const noexcept
const llvm::PointerType & GetPointerType() const noexcept
bool operator==(const Operation &other) const noexcept override
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateOutTypes(std::shared_ptr< const rvsdg::Type > pointeeType, size_t numStates)
std::unique_ptr< Operation > copy() const override
~LoadOperation() noexcept override
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateInTypes(std::shared_ptr< const rvsdg::Type > pointeeType, size_t numStates)
std::string debug_string() const override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &addr, const std::vector< jlm::rvsdg::Output * > &states, jlm::rvsdg::Output &load_result)
bool operator==(const Operation &other) const 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)
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< 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
bool operator==(const Operation &) const noexcept override
static std::vector< jlm::rvsdg::Output * > create(std::shared_ptr< const llvm::ArrayType > at, rvsdg::Region *region)
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
~LocalMemoryOperation() noexcept override
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
~LocalMemoryRequestOperation() 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)
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)
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< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &mem, size_t resp_count)
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
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)
const jlm::rvsdg::Type & GetStoredType() const noexcept
bool operator==(const Operation &other) const 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)
static std::vector< std::shared_ptr< const jlm::rvsdg::Type > > CreateOutTypes(const std::shared_ptr< const jlm::rvsdg::Type > &valuetype, size_t numStates)
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &predicate, jlm::rvsdg::Output &value)
std::string debug_string() const override
bool operator==(const Operation &other) const noexcept override
~LoopConstantBufferOperation() noexcept override
std::unique_ptr< Operation > copy() const override
rvsdg::RegionResult * predicate() const noexcept
rvsdg::Output & GetPredicateBuffer() const noexcept
~LoopNode() noexcept override=default
std::unique_ptr< Operation > copy() const override
~LoopOperation() noexcept override
const std::vector< std::shared_ptr< const rvsdg::Type > > * GetLoadTypes() const
const std::vector< std::shared_ptr< const rvsdg::Type > > * GetStoreTypes() const
~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)
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 *)
size_t get_nloads() const
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)
bool operator==(const Operation &other) const noexcept override
MemoryRequestOperation(const MemoryRequestOperation &other)=default
std::unique_ptr< Operation > copy() const override
std::vector< std::shared_ptr< const rvsdg::Type > > LoadTypes_
std::string debug_string() const override
std::vector< std::shared_ptr< const rvsdg::Type > > StoreTypes_
std::unique_ptr< Operation > copy() const override
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)
static std::vector< jlm::rvsdg::Output * > create(rvsdg::Output &result, const std::vector< std::shared_ptr< const rvsdg::Type > > &output_types, int in_width)
std::string debug_string() const override
~MemoryResponseOperation() noexcept override
bool operator==(const Operation &other) const noexcept override
~MuxOperation() 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)
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
bool operator==(const Operation &other) const noexcept override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &predicate, const std::vector< jlm::rvsdg::Output * > &alternatives, bool discarding, bool loop=false)
~PredicateBufferOperation() 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::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &predicate)
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &value)
std::unique_ptr< Operation > copy() const override
bool operator==(const Operation &) const noexcept override
~PrintOperation() noexcept override
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< std::shared_ptr< const jlm::rvsdg::Type > > CreateInOutTypes(const std::shared_ptr< const jlm::rvsdg::Type > &type, size_t numStates)
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &addr, const std::vector< jlm::rvsdg::Output * > &states)
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 rvsdg::Type > &pointeeType, size_t numStates)
~StoreOperation() noexcept override
std::unique_ptr< Operation > copy() const override
bool operator==(const Operation &other) const noexcept override
const rvsdg::Type & GetStoredType() const noexcept
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
const llvm::PointerType & GetPointerType() const noexcept
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
std::string debug_string() const override
std::unique_ptr< Operation > copy() const override
static std::vector< jlm::rvsdg::Output * > create(jlm::rvsdg::Output &tg, jlm::rvsdg::Output &value)
~TriggerOperation() noexcept override
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 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
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::vector< jlm::rvsdg::Output * > operands(const Node *node)
static std::vector< jlm::rvsdg::Output * > outputs(const Node *node)
TypeKind
The kinds of types supported in rvsdg.
NodeType * TryGetOwnerNode(const rvsdg::Input &input) noexcept
Checks if this is an input to a node of specified type.
static std::string strfmt(Args... args)
Variable passed between hls loop iterations.
rvsdg::Output * pre
Variable at beginning of loop (pre-iteration value).
rvsdg::Input * post
Variable at end of loop (post-iteration value).
Variable entering the hls loop.
rvsdg::Output * inner
Variable in region representing entry value.
rvsdg::Input * input
Variable at loop entry.
Variable exiting the hls loop.
rvsdg::Output * output
Variable after loop exit.
rvsdg::Input * inner
Variable in region representing exit value.