Skip to content

Commit

Permalink
Rename structural_node class to StructuralNode (phate#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
phate authored Oct 12, 2024
1 parent b8f81a0 commit d5a6f0a
Show file tree
Hide file tree
Showing 65 changed files with 182 additions and 188 deletions.
2 changes: 1 addition & 1 deletion jlm/hls/backend/rhls2firrtl/RhlsToFirrtlConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2517,7 +2517,7 @@ RhlsToFirrtlConverter::TraceArgument(rvsdg::RegionArgument * arg)
else if (auto o = dynamic_cast<jlm::rvsdg::structural_output *>(origin))
{
// Check if we the input of one loop_node is connected to the output of another
// structural_node, i.e., if the input is connected to the output of another loop_node
// StructuralNode, i.e., if the input is connected to the output of another loop_node
return TraceStructuralOutput(o);
}
// Else we have reached the source
Expand Down
4 changes: 2 additions & 2 deletions jlm/hls/backend/rvsdg2rhls/GammaConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static void
ConvertGammaNodesInRegion(rvsdg::Region & region);

static void
ConvertGammaNodesInStructuralNode(rvsdg::structural_node & structuralNode)
ConvertGammaNodesInStructuralNode(rvsdg::StructuralNode & structuralNode)
{
for (size_t n = 0; n < structuralNode.nsubregions(); n++)
{
Expand All @@ -159,7 +159,7 @@ ConvertGammaNodesInRegion(rvsdg::Region & region)
{
for (auto & node : rvsdg::topdown_traverser(&region))
{
if (auto structuralNode = dynamic_cast<rvsdg::structural_node *>(node))
if (auto structuralNode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
ConvertGammaNodesInStructuralNode(*structuralNode);
}
Expand Down
4 changes: 2 additions & 2 deletions jlm/hls/backend/rvsdg2rhls/ThetaConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static void
ConvertThetaNodesInRegion(rvsdg::Region & region);

static void
ConvertThetaNodesInStructuralNode(jlm::rvsdg::structural_node & structuralNode)
ConvertThetaNodesInStructuralNode(rvsdg::StructuralNode & structuralNode)
{
for (size_t n = 0; n < structuralNode.nsubregions(); n++)
{
Expand All @@ -65,7 +65,7 @@ ConvertThetaNodesInRegion(rvsdg::Region & region)
{
for (auto & node : jlm::rvsdg::topdown_traverser(&region))
{
if (auto structuralNode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structuralNode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
ConvertThetaNodesInStructuralNode(*structuralNode);
}
Expand Down
4 changes: 2 additions & 2 deletions jlm/hls/backend/rvsdg2rhls/UnusedStateRemoval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static void
RemoveUnusedStatesInRegion(rvsdg::Region & region);

static void
RemoveUnusedStatesInStructuralNode(rvsdg::structural_node & structuralNode)
RemoveUnusedStatesInStructuralNode(rvsdg::StructuralNode & structuralNode)
{
// Remove unused states from innermost regions first
for (size_t n = 0; n < structuralNode.nsubregions(); n++)
Expand All @@ -218,7 +218,7 @@ RemoveUnusedStatesInRegion(rvsdg::Region & region)
{
for (auto & node : rvsdg::topdown_traverser(&region))
{
if (auto structuralNode = dynamic_cast<rvsdg::structural_node *>(node))
if (auto structuralNode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
RemoveUnusedStatesInStructuralNode(*structuralNode);
}
Expand Down
2 changes: 1 addition & 1 deletion jlm/hls/backend/rvsdg2rhls/add-buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ add_buffers(rvsdg::Region * region, bool pass_through)
{
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (auto structnode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structnode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
for (size_t n = 0; n < structnode->nsubregions(); n++)
{
Expand Down
2 changes: 1 addition & 1 deletion jlm/hls/backend/rvsdg2rhls/add-forks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ add_forks(rvsdg::Region * region)
}
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (auto structnode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structnode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
for (size_t n = 0; n < structnode->nsubregions(); n++)
{
Expand Down
4 changes: 2 additions & 2 deletions jlm/hls/backend/rvsdg2rhls/add-prints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ add_prints(rvsdg::Region * region)
{
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (auto structnode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structnode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
for (size_t n = 0; n < structnode->nsubregions(); n++)
{
Expand Down Expand Up @@ -106,7 +106,7 @@ convert_prints(
{
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (auto structnode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structnode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
for (size_t n = 0; n < structnode->nsubregions(); n++)
{
Expand Down
2 changes: 1 addition & 1 deletion jlm/hls/backend/rvsdg2rhls/add-sinks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ add_sinks(rvsdg::Region * region)
}
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (auto structnode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structnode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
for (size_t n = 0; n < structnode->nsubregions(); n++)
{
Expand Down
2 changes: 1 addition & 1 deletion jlm/hls/backend/rvsdg2rhls/add-triggers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ add_triggers(rvsdg::Region * region)
auto trigger = get_trigger(region);
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (rvsdg::is<rvsdg::structural_op>(node))
{
if (auto ln = dynamic_cast<llvm::lambda::node *>(node))
{
Expand Down
2 changes: 1 addition & 1 deletion jlm/hls/backend/rvsdg2rhls/alloca-conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ alloca_conv(rvsdg::Region * region)
{
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (auto structnode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structnode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
for (size_t n = 0; n < structnode->nsubregions(); n++)
{
Expand Down
2 changes: 1 addition & 1 deletion jlm/hls/backend/rvsdg2rhls/check-rhls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ check_rhls(rvsdg::Region * sr)
{
for (auto & node : jlm::rvsdg::topdown_traverser(sr))
{
if (dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (rvsdg::is<rvsdg::structural_op>(node))
{
if (auto ln = dynamic_cast<hls::loop_node *>(node))
{
Expand Down
4 changes: 2 additions & 2 deletions jlm/hls/backend/rvsdg2rhls/dae-conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ process_loopnode(loop_node * loopNode)
bool can_decouple = true;
for (auto sn : data_slice)
{
if (dynamic_cast<jlm::rvsdg::structural_node *>(sn))
if (rvsdg::is<rvsdg::structural_op>(sn))
{
// data slice may not contain loops
can_decouple = false;
Expand Down Expand Up @@ -420,7 +420,7 @@ process_loopnode(loop_node * loopNode)
JLM_ASSERT(!can_decouple || !data_slice.count(simplenode));
for (auto sn : state_slice)
{
if (dynamic_cast<jlm::rvsdg::structural_node *>(sn))
if (rvsdg::is<rvsdg::structural_op>(sn))
{
// state slice may not contain loops
can_decouple = false;
Expand Down
2 changes: 1 addition & 1 deletion jlm/hls/backend/rvsdg2rhls/distribute-constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ hls::distribute_constants(rvsdg::Region * region)
// buffers for them
for (auto & node : rvsdg::topdown_traverser(region))
{
if (dynamic_cast<rvsdg::structural_node *>(node))
if (rvsdg::is<rvsdg::structural_op>(node))
{
if (auto ln = dynamic_cast<llvm::lambda::node *>(node))
{
Expand Down
2 changes: 1 addition & 1 deletion jlm/hls/backend/rvsdg2rhls/instrument-ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ instrument_ref(
auto void_ptr = jlm::llvm::PointerType::Create();
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (auto structnode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structnode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
for (size_t n = 0; n < structnode->nsubregions(); n++)
{
Expand Down
2 changes: 1 addition & 1 deletion jlm/hls/backend/rvsdg2rhls/mem-conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ gather_mem_nodes(
{
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (auto structnode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structnode = dynamic_cast<jlm::rvsdg::StructuralNode *>(node))
{
for (size_t n = 0; n < structnode->nsubregions(); n++)
gather_mem_nodes(
Expand Down
2 changes: 1 addition & 1 deletion jlm/hls/backend/rvsdg2rhls/mem-sep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ gather_mem_nodes(rvsdg::Region * region, std::vector<jlm::rvsdg::simple_node *>
{
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (auto structnode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structnode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
for (size_t n = 0; n < structnode->nsubregions(); n++)
gather_mem_nodes(structnode->subregion(n), mem_nodes);
Expand Down
2 changes: 1 addition & 1 deletion jlm/hls/backend/rvsdg2rhls/memstate-conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ memstate_conv(rvsdg::Region * region)
{
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (auto structnode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structnode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
for (size_t n = 0; n < structnode->nsubregions(); n++)
memstate_conv(structnode->subregion(n));
Expand Down
2 changes: 1 addition & 1 deletion jlm/hls/backend/rvsdg2rhls/merge-gamma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ merge_gamma(rvsdg::Region * region)
changed = false;
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (auto structnode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structnode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
for (size_t n = 0; n < structnode->nsubregions(); n++)
merge_gamma(structnode->subregion(n));
Expand Down
2 changes: 1 addition & 1 deletion jlm/hls/backend/rvsdg2rhls/remove-redundant-buf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ remove_redundant_buf(rvsdg::Region * region)
{
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (auto structnode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structnode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
for (size_t n = 0; n < structnode->nsubregions(); n++)
{
Expand Down
2 changes: 1 addition & 1 deletion jlm/hls/backend/rvsdg2rhls/remove-unused-state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ remove_unused_state(rvsdg::Region * region, bool can_remove_arguments)
// process children first so that unnecessary users get removed
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (auto structnode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structnode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
if (auto gn = dynamic_cast<rvsdg::GammaNode *>(node))
{
Expand Down
4 changes: 2 additions & 2 deletions jlm/hls/backend/rvsdg2rhls/rvsdg2rhls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ inline_calls(rvsdg::Region * region)
{
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (auto structnode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structnode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
for (size_t n = 0; n < structnode->nsubregions(); n++)
{
Expand Down Expand Up @@ -180,7 +180,7 @@ convert_alloca(rvsdg::Region * region)
{
for (auto & node : jlm::rvsdg::topdown_traverser(region))
{
if (auto structnode = dynamic_cast<jlm::rvsdg::structural_node *>(node))
if (auto structnode = dynamic_cast<rvsdg::StructuralNode *>(node))
{
for (size_t n = 0; n < structnode->nsubregions(); n++)
{
Expand Down
6 changes: 3 additions & 3 deletions jlm/hls/ir/hls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -743,15 +743,15 @@ class ExitResult final : public rvsdg::RegionResult
}
};

class loop_node final : public jlm::rvsdg::structural_node
class loop_node final : public rvsdg::StructuralNode
{
public:
virtual ~loop_node()
{}

private:
inline loop_node(rvsdg::Region * parent)
: structural_node(loop_op(), parent, 1)
: StructuralNode(loop_op(), parent, 1)
{}

jlm::rvsdg::node_output * _predicate_buffer;
Expand All @@ -763,7 +763,7 @@ class loop_node final : public jlm::rvsdg::structural_node
rvsdg::Region *
subregion() const noexcept
{
return structural_node::subregion(0);
return StructuralNode::subregion(0);
}

[[nodiscard]] rvsdg::RegionResult *
Expand Down
Loading

0 comments on commit d5a6f0a

Please sign in to comment.