diff --git a/jlm/hls/backend/rhls2firrtl/RhlsToFirrtlConverter.cpp b/jlm/hls/backend/rhls2firrtl/RhlsToFirrtlConverter.cpp index 153962534..daa0f3624 100644 --- a/jlm/hls/backend/rhls2firrtl/RhlsToFirrtlConverter.cpp +++ b/jlm/hls/backend/rhls2firrtl/RhlsToFirrtlConverter.cpp @@ -15,7 +15,7 @@ namespace jlm::hls // Handles nodes with 2 inputs and 1 output circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenSimpleNode(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenSimpleNode(const jlm::rvsdg::SimpleNode * node) { // Only handles nodes with a single output if (node->noutputs() != 1) @@ -385,7 +385,7 @@ RhlsToFirrtlConverter::MlirGenSimpleNode(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenSink(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenSink(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node); @@ -410,7 +410,7 @@ RhlsToFirrtlConverter::MlirGenSink(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenLoopConstBuffer(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenLoopConstBuffer(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node); @@ -465,7 +465,7 @@ RhlsToFirrtlConverter::MlirGenLoopConstBuffer(const jlm::rvsdg::simple_node * no } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenFork(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenFork(const jlm::rvsdg::SimpleNode * node) { auto op = dynamic_cast(&node->GetOperation()); bool isConstant = op->IsConstant(); @@ -567,7 +567,7 @@ RhlsToFirrtlConverter::MlirGenFork(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenStateGate(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenStateGate(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node); @@ -659,7 +659,7 @@ RhlsToFirrtlConverter::MlirGenStateGate(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenHlsMemResp(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenHlsMemResp(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node, false); @@ -740,7 +740,7 @@ RhlsToFirrtlConverter::MlirGenHlsMemResp(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenHlsMemReq(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenHlsMemReq(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node, false); @@ -902,7 +902,7 @@ RhlsToFirrtlConverter::MlirGenHlsMemReq(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenHlsLoad(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenHlsLoad(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node, false); @@ -1077,7 +1077,7 @@ RhlsToFirrtlConverter::MlirGenHlsLoad(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenHlsDLoad(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenHlsDLoad(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node, false); @@ -1124,7 +1124,7 @@ RhlsToFirrtlConverter::MlirGenHlsDLoad(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenHlsLocalMem(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenHlsLocalMem(const jlm::rvsdg::SimpleNode * node) { auto lmem_op = dynamic_cast(&(node->GetOperation())); JLM_ASSERT(lmem_op); @@ -1333,7 +1333,7 @@ RhlsToFirrtlConverter::MlirGenHlsLocalMem(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenHlsStore(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenHlsStore(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node, false); @@ -1477,7 +1477,7 @@ RhlsToFirrtlConverter::MlirGenHlsStore(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenMem(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenMem(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node, true); @@ -1694,7 +1694,7 @@ RhlsToFirrtlConverter::MlirGenMem(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenTrigger(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenTrigger(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node); @@ -1728,7 +1728,7 @@ RhlsToFirrtlConverter::MlirGenTrigger(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenPrint(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenPrint(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node); @@ -1763,7 +1763,7 @@ RhlsToFirrtlConverter::MlirGenPrint(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenPredicationBuffer(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenPredicationBuffer(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node); @@ -1828,7 +1828,7 @@ RhlsToFirrtlConverter::MlirGenPredicationBuffer(const jlm::rvsdg::simple_node * } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenBuffer(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenBuffer(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node); @@ -1968,7 +1968,7 @@ RhlsToFirrtlConverter::MlirGenBuffer(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenAddrQueue(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenAddrQueue(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node); @@ -2136,7 +2136,7 @@ RhlsToFirrtlConverter::MlirGenAddrQueue(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenDMux(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenDMux(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node); @@ -2275,7 +2275,7 @@ RhlsToFirrtlConverter::MlirGenDMux(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenNDMux(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenNDMux(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node); @@ -2322,7 +2322,7 @@ RhlsToFirrtlConverter::MlirGenNDMux(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGenBranch(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGenBranch(const jlm::rvsdg::SimpleNode * node) { // Create the module and its input/output ports auto module = nodeToModule(node); @@ -2369,7 +2369,7 @@ RhlsToFirrtlConverter::MlirGenBranch(const jlm::rvsdg::simple_node * node) } circt::firrtl::FModuleOp -RhlsToFirrtlConverter::MlirGen(const jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::MlirGen(const jlm::rvsdg::SimpleNode * node) { if (dynamic_cast(&(node->GetOperation()))) { @@ -2468,7 +2468,7 @@ RhlsToFirrtlConverter::MlirGen(const jlm::rvsdg::simple_node * node) return MlirGenSimpleNode(node); } -std::unordered_map +std::unordered_map RhlsToFirrtlConverter::MlirGen( hls::loop_node * loopNode, mlir::Block * body, @@ -2571,7 +2571,7 @@ RhlsToFirrtlConverter::MlirGen(rvsdg::Region * subRegion, mlir::Block * circuitB auto body = module.getBodyBlock(); // First we create and instantiate all the modules and keep them in a dictionary - std::unordered_map instances = + std::unordered_map instances = createInstances(subRegion, circuitBody, body); // Wire up the instances for (const auto & instance : instances) @@ -2620,7 +2620,7 @@ RhlsToFirrtlConverter::MlirGen(rvsdg::Region * subRegion, mlir::Block * circuitB { // Connect directly to mem auto mem_out = dynamic_cast(source->input(0)->origin()); - auto sourceNode = instances[dynamic_cast(mem_out->node())]; + auto sourceNode = instances[dynamic_cast(mem_out->node())]; auto sourcePort = GetInstancePort(sourceNode, "o" + std::to_string(o->index())); auto sinkPort = sinkNode->getResult(i + 2); Connect(body, sinkPort, sourcePort); @@ -2712,7 +2712,7 @@ RhlsToFirrtlConverter::MlirGen(rvsdg::Region * subRegion, mlir::Block * circuitB throw std::logic_error("Unsupported output"); } // Get the node of the output - jlm::rvsdg::simple_node * source = output->node(); + jlm::rvsdg::SimpleNode * source = output->node(); // Get the corresponding InstanceOp auto sourceNode = instances[source]; // Calculate the result port of the instance: @@ -2736,7 +2736,7 @@ RhlsToFirrtlConverter::MlirGen(rvsdg::Region * subRegion, mlir::Block * circuitB return module; } -std::unordered_map +std::unordered_map RhlsToFirrtlConverter::createInstances( rvsdg::Region * subRegion, mlir::Block * circuitBody, @@ -2745,10 +2745,10 @@ RhlsToFirrtlConverter::createInstances( // create and instantiate all the modules and keep them in a dictionary auto clock = body->getArgument(0); auto reset = body->getArgument(1); - std::unordered_map instances; + std::unordered_map instances; for (const auto node : jlm::rvsdg::topdown_traverser(subRegion)) { - if (auto sn = dynamic_cast(node)) + if (auto sn = dynamic_cast(node)) { if (dynamic_cast(&(node->GetOperation())) || dynamic_cast(&(node->GetOperation()))) @@ -3728,7 +3728,7 @@ RhlsToFirrtlConverter::check_module(circt::firrtl::FModuleOp & module) } circt::firrtl::InstanceOp -RhlsToFirrtlConverter::AddInstanceOp(mlir::Block * body, jlm::rvsdg::simple_node * node) +RhlsToFirrtlConverter::AddInstanceOp(mlir::Block * body, jlm::rvsdg::SimpleNode * node) { auto name = GetModuleName(node); // Check if the module has already been instantiated else we need to generate it @@ -3855,11 +3855,11 @@ RhlsToFirrtlConverter::InitializeMemReq(circt::firrtl::FModuleOp module) Connect(body, memWidth, invalid3); } -// Takes a jlm::rvsdg::simple_node and creates a firrtl module with an input +// Takes a jlm::rvsdg::SimpleNode and creates a firrtl module with an input // bundle for each node input and output bundle for each node output // Returns a circt::firrtl::FModuleOp with an empty body circt::firrtl::FModuleOp -RhlsToFirrtlConverter::nodeToModule(const jlm::rvsdg::simple_node * node, bool mem) +RhlsToFirrtlConverter::nodeToModule(const jlm::rvsdg::SimpleNode * node, bool mem) { // Generate a vector with all inputs and outputs of the module ::llvm::SmallVector ports; diff --git a/jlm/hls/backend/rhls2firrtl/RhlsToFirrtlConverter.hpp b/jlm/hls/backend/rhls2firrtl/RhlsToFirrtlConverter.hpp index 922973327..373edff25 100644 --- a/jlm/hls/backend/rhls2firrtl/RhlsToFirrtlConverter.hpp +++ b/jlm/hls/backend/rhls2firrtl/RhlsToFirrtlConverter.hpp @@ -104,23 +104,23 @@ class RhlsToFirrtlConverter : public BaseHLS std::unordered_map modules; // FIRRTL generating functions - std::unordered_map + std::unordered_map MlirGen(hls::loop_node * loopNode, mlir::Block * body, mlir::Block * circuitBody); circt::firrtl::FModuleOp MlirGen(rvsdg::Region * subRegion, mlir::Block * circuitBody); circt::firrtl::FModuleOp - MlirGen(const jlm::rvsdg::simple_node * node); + MlirGen(const jlm::rvsdg::SimpleNode * node); // Operations circt::firrtl::FModuleOp - MlirGenSink(const jlm::rvsdg::simple_node * node); + MlirGenSink(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenLoopConstBuffer(const jlm::rvsdg::simple_node * node); + MlirGenLoopConstBuffer(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenFork(const jlm::rvsdg::simple_node * node); + MlirGenFork(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenStateGate(const jlm::rvsdg::simple_node * node); + MlirGenStateGate(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenMem(const jlm::rvsdg::simple_node * node); + MlirGenMem(const jlm::rvsdg::SimpleNode * node); /** * Generate a FIRRTL module for a HLS memory response node that implements the functionality for * retreiving memory responses. @@ -128,7 +128,7 @@ class RhlsToFirrtlConverter : public BaseHLS * @return The generated FIRRTL module. */ circt::firrtl::FModuleOp - MlirGenHlsMemResp(const jlm::rvsdg::simple_node * node); + MlirGenHlsMemResp(const jlm::rvsdg::SimpleNode * node); /** * Generate a FIRRTL module for a HLS memory request node that implements the functionality for * performing memory requests. @@ -136,33 +136,33 @@ class RhlsToFirrtlConverter : public BaseHLS * @return The generated FIRRTL module. */ circt::firrtl::FModuleOp - MlirGenHlsMemReq(const jlm::rvsdg::simple_node * node); + MlirGenHlsMemReq(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenHlsLoad(const jlm::rvsdg::simple_node * node); + MlirGenHlsLoad(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenHlsDLoad(const jlm::rvsdg::simple_node * node); + MlirGenHlsDLoad(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenHlsLocalMem(const jlm::rvsdg::simple_node * node); + MlirGenHlsLocalMem(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenHlsStore(const jlm::rvsdg::simple_node * node); + MlirGenHlsStore(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenTrigger(const jlm::rvsdg::simple_node * node); + MlirGenTrigger(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenPrint(const jlm::rvsdg::simple_node * node); + MlirGenPrint(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenAddrQueue(const jlm::rvsdg::simple_node * node); + MlirGenAddrQueue(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenPredicationBuffer(const jlm::rvsdg::simple_node * node); + MlirGenPredicationBuffer(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenBuffer(const jlm::rvsdg::simple_node * node); + MlirGenBuffer(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenDMux(const jlm::rvsdg::simple_node * node); + MlirGenDMux(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenNDMux(const jlm::rvsdg::simple_node * node); + MlirGenNDMux(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenBranch(const jlm::rvsdg::simple_node * node); + MlirGenBranch(const jlm::rvsdg::SimpleNode * node); circt::firrtl::FModuleOp - MlirGenSimpleNode(const jlm::rvsdg::simple_node * node); + MlirGenSimpleNode(const jlm::rvsdg::SimpleNode * node); // Helper functions void @@ -247,7 +247,7 @@ class RhlsToFirrtlConverter : public BaseHLS circt::firrtl::WhenOp AddWhenOp(mlir::Block * body, mlir::Value condition, bool elseStatment); circt::firrtl::InstanceOp - AddInstanceOp(mlir::Block * body, jlm::rvsdg::simple_node * node); + AddInstanceOp(mlir::Block * body, jlm::rvsdg::SimpleNode * node); circt::firrtl::ConstantOp GetConstant(mlir::Block * body, int size, int value); circt::firrtl::InvalidValueOp @@ -274,7 +274,7 @@ class RhlsToFirrtlConverter : public BaseHLS mlir::BlockArgument GetResetSignal(circt::firrtl::FModuleOp module); circt::firrtl::FModuleOp - nodeToModule(const jlm::rvsdg::simple_node * node, bool mem = false); + nodeToModule(const jlm::rvsdg::SimpleNode * node, bool mem = false); circt::firrtl::IntType GetIntType(int size); circt::firrtl::IntType @@ -286,7 +286,7 @@ class RhlsToFirrtlConverter : public BaseHLS bool IsIdentityMapping(const jlm::rvsdg::match_op & op); - std::unordered_map + std::unordered_map createInstances(rvsdg::Region * subRegion, mlir::Block * circuitBody, mlir::Block * body); void check_module(circt::firrtl::FModuleOp & module); diff --git a/jlm/hls/backend/rhls2firrtl/base-hls.cpp b/jlm/hls/backend/rhls2firrtl/base-hls.cpp index e4cb17207..84fac591a 100644 --- a/jlm/hls/backend/rhls2firrtl/base-hls.cpp +++ b/jlm/hls/backend/rhls2firrtl/base-hls.cpp @@ -140,7 +140,7 @@ BaseHLS::create_node_names(rvsdg::Region * r) { for (auto & node : r->Nodes()) { - if (dynamic_cast(&node)) + if (dynamic_cast(&node)) { get_node_name(&node); } diff --git a/jlm/hls/backend/rhls2firrtl/dot-hls.cpp b/jlm/hls/backend/rhls2firrtl/dot-hls.cpp index 52782c33e..8477f7818 100644 --- a/jlm/hls/backend/rhls2firrtl/dot-hls.cpp +++ b/jlm/hls/backend/rhls2firrtl/dot-hls.cpp @@ -216,7 +216,7 @@ DotHLS::loop_to_dot(hls::loop_node * ln) for (auto node : jlm::rvsdg::topdown_traverser(sr)) { - if (dynamic_cast(node)) + if (dynamic_cast(node)) { auto node_dot = node_to_dot(node); if (top_nodes.count(node)) @@ -272,7 +272,7 @@ DotHLS::loop_to_dot(hls::loop_node * ln) // do edges outside in order not to pull other nodes into the cluster for (auto node : jlm::rvsdg::topdown_traverser(sr)) { - if (dynamic_cast(node)) + if (dynamic_cast(node)) { auto mx = dynamic_cast(&node->GetOperation()); auto node_name = get_node_name(node); @@ -307,7 +307,7 @@ DotHLS::prepare_loop_out_port(hls::loop_node * ln) // just translate outputs for (auto node : jlm::rvsdg::topdown_traverser(sr)) { - if (dynamic_cast(node)) + if (dynamic_cast(node)) { auto node_name = get_node_name(node); for (size_t i = 0; i < node->noutputs(); ++i) @@ -388,7 +388,7 @@ DotHLS::subregion_to_dot(rvsdg::Region * sr) // process nodes for (auto node : jlm::rvsdg::topdown_traverser(sr)) { - if (dynamic_cast(node)) + if (dynamic_cast(node)) { auto node_dot = node_to_dot(node); dot << node_dot; diff --git a/jlm/hls/backend/rvsdg2rhls/add-buffers.cpp b/jlm/hls/backend/rvsdg2rhls/add-buffers.cpp index b0ac75705..806c30d1c 100644 --- a/jlm/hls/backend/rvsdg2rhls/add-buffers.cpp +++ b/jlm/hls/backend/rvsdg2rhls/add-buffers.cpp @@ -23,7 +23,7 @@ add_buffers(rvsdg::Region * region, bool pass_through) add_buffers(structnode->subregion(n), pass_through); } } - else if (dynamic_cast(node)) + else if (dynamic_cast(node)) { if (jlm::rvsdg::is(node) || jlm::rvsdg::is(node)) { diff --git a/jlm/hls/backend/rvsdg2rhls/add-prints.cpp b/jlm/hls/backend/rvsdg2rhls/add-prints.cpp index 297310b1e..29f98c916 100644 --- a/jlm/hls/backend/rvsdg2rhls/add-prints.cpp +++ b/jlm/hls/backend/rvsdg2rhls/add-prints.cpp @@ -31,7 +31,7 @@ add_prints(rvsdg::Region * region) // auto po = hls::print_op::create(*node->input(1)->origin())[0]; // node->input(1)->divert_to(po); // } - if (dynamic_cast(node) && node->noutputs() == 1 + if (dynamic_cast(node) && node->noutputs() == 1 && jlm::rvsdg::is(node->output(0)->type()) && !jlm::rvsdg::is(node)) { @@ -123,7 +123,7 @@ convert_prints( auto bt = dynamic_cast(&val->type()); JLM_ASSERT(bt); auto op = llvm::zext_op(bt->nbits(), 64); - val = jlm::rvsdg::simple_node::create_normalized(region, op, { val })[0]; + val = jlm::rvsdg::SimpleNode::create_normalized(region, op, { val })[0]; } llvm::CallNode::Create(printf_local, functionType, { bc, val }); node->output(0)->divert_users(node->input(0)->origin()); diff --git a/jlm/hls/backend/rvsdg2rhls/add-triggers.cpp b/jlm/hls/backend/rvsdg2rhls/add-triggers.cpp index 4dbb0eac8..93e04e0af 100644 --- a/jlm/hls/backend/rvsdg2rhls/add-triggers.cpp +++ b/jlm/hls/backend/rvsdg2rhls/add-triggers.cpp @@ -124,7 +124,7 @@ add_triggers(rvsdg::Region * region) throw jlm::util::error("Unexpected node type: " + node->GetOperation().debug_string()); } } - else if (auto sn = dynamic_cast(node)) + else if (auto sn = dynamic_cast(node)) { JLM_ASSERT(trigger != nullptr); if (is_constant(node)) diff --git a/jlm/hls/backend/rvsdg2rhls/alloca-conv.cpp b/jlm/hls/backend/rvsdg2rhls/alloca-conv.cpp index 45d08eba9..fbc02d960 100644 --- a/jlm/hls/backend/rvsdg2rhls/alloca-conv.cpp +++ b/jlm/hls/backend/rvsdg2rhls/alloca-conv.cpp @@ -23,8 +23,8 @@ namespace jlm::hls class TraceAllocaUses { public: - std::vector load_nodes; - std::vector store_nodes; + std::vector load_nodes; + std::vector store_nodes; TraceAllocaUses(jlm::rvsdg::output * op) { diff --git a/jlm/hls/backend/rvsdg2rhls/dae-conv.cpp b/jlm/hls/backend/rvsdg2rhls/dae-conv.cpp index ae7c50069..02cf0b147 100644 --- a/jlm/hls/backend/rvsdg2rhls/dae-conv.cpp +++ b/jlm/hls/backend/rvsdg2rhls/dae-conv.cpp @@ -219,7 +219,7 @@ dump_xml(const rvsdg::Region * region, const std::string & file_name) void decouple_load( loop_node * loopNode, - jlm::rvsdg::simple_node * loadNode, + jlm::rvsdg::SimpleNode * loadNode, std::unordered_set & loop_slice) { // loadNode is always a part of loop_slice due to state edges @@ -377,7 +377,7 @@ process_loopnode(loop_node * loopNode) return true; } } - else if (auto simplenode = dynamic_cast(node)) + else if (auto simplenode = dynamic_cast(node)) { if (dynamic_cast(&simplenode->GetOperation())) { diff --git a/jlm/hls/backend/rvsdg2rhls/distribute-constants.cpp b/jlm/hls/backend/rvsdg2rhls/distribute-constants.cpp index 0bb6d26bc..438be104a 100644 --- a/jlm/hls/backend/rvsdg2rhls/distribute-constants.cpp +++ b/jlm/hls/backend/rvsdg2rhls/distribute-constants.cpp @@ -33,10 +33,10 @@ distribute_constant(const rvsdg::SimpleOperation & op, rvsdg::simple_output * ou { // pass-through auto arg_replacement = dynamic_cast( - rvsdg::simple_node::create_normalized(ti->node()->subregion(), op, {})[0]); + rvsdg::SimpleNode::create_normalized(ti->node()->subregion(), op, {})[0]); ti->argument()->divert_users(arg_replacement); ti->output()->divert_users( - rvsdg::simple_node::create_normalized(out->region(), op, {})[0]); + rvsdg::SimpleNode::create_normalized(out->region(), op, {})[0]); distribute_constant(op, arg_replacement); arg->region()->RemoveResult(res->index()); arg->region()->RemoveArgument(arg->index()); @@ -57,7 +57,7 @@ distribute_constant(const rvsdg::SimpleOperation & op, rvsdg::simple_output * ou if (argument->nusers()) { auto arg_replacement = dynamic_cast( - rvsdg::simple_node::create_normalized(argument->region(), op, {})[0]); + rvsdg::SimpleNode::create_normalized(argument->region(), op, {})[0]); argument->divert_users(arg_replacement); distribute_constant(op, arg_replacement); } @@ -100,7 +100,7 @@ hls::distribute_constants(rvsdg::Region * region) throw util::error("Unexpected node type: " + node->GetOperation().debug_string()); } } - else if (auto sn = dynamic_cast(node)) + else if (auto sn = dynamic_cast(node)) { if (is_constant(node)) { diff --git a/jlm/hls/backend/rvsdg2rhls/instrument-ref.cpp b/jlm/hls/backend/rvsdg2rhls/instrument-ref.cpp index 8d4a66fc8..5393959eb 100644 --- a/jlm/hls/backend/rvsdg2rhls/instrument-ref.cpp +++ b/jlm/hls/backend/rvsdg2rhls/instrument-ref.cpp @@ -245,7 +245,7 @@ instrument_ref( if (*dbt != *jlm::rvsdg::bittype::Create(64)) { jlm::llvm::zext_op op(dbt->nbits(), 64); - data = jlm::rvsdg::simple_node::create_normalized(data->region(), op, { data })[0]; + data = jlm::rvsdg::SimpleNode::create_normalized(data->region(), op, { data })[0]; } auto memstate = node->input(2)->origin(); auto callOp = jlm::llvm::CallNode::Create( diff --git a/jlm/hls/backend/rvsdg2rhls/mem-conv.cpp b/jlm/hls/backend/rvsdg2rhls/mem-conv.cpp index acaf0ba73..cb664d3ac 100644 --- a/jlm/hls/backend/rvsdg2rhls/mem-conv.cpp +++ b/jlm/hls/backend/rvsdg2rhls/mem-conv.cpp @@ -53,8 +53,8 @@ jlm::hls::route_request(rvsdg::Region * target, jlm::rvsdg::output * request) } } -jlm::rvsdg::simple_node * -replace_load(jlm::rvsdg::simple_node * orig, jlm::rvsdg::output * resp) +jlm::rvsdg::SimpleNode * +replace_load(jlm::rvsdg::SimpleNode * orig, jlm::rvsdg::output * resp) { auto addr = orig->input(0)->origin(); std::vector states; @@ -78,7 +78,7 @@ replace_load(jlm::rvsdg::simple_node * orig, jlm::rvsdg::output * resp) orig->output(i)->divert_users(nn->output(i)); } remove(orig); - return dynamic_cast(nn); + return dynamic_cast(nn); } const jlm::rvsdg::bitconstant_op * @@ -178,7 +178,7 @@ get_impport_function_name(jlm::rvsdg::input * input) void trace_function_calls( jlm::rvsdg::output * output, - std::vector & calls, + std::vector & calls, std::unordered_set & visited) { if (visited.count(output)) @@ -230,7 +230,7 @@ trace_function_calls( } } -jlm::rvsdg::simple_node * +jlm::rvsdg::SimpleNode * find_decouple_response( const jlm::llvm::lambda::node * lambda, const jlm::rvsdg::bitconstant_op * request_constant) @@ -246,7 +246,7 @@ find_decouple_response( } } JLM_ASSERT(response_function == nullptr); - std::vector reponse_calls; + std::vector reponse_calls; std::unordered_set visited; trace_function_calls(response_function, reponse_calls, visited); JLM_ASSERT(!reponse_calls.empty()); @@ -261,10 +261,10 @@ find_decouple_response( JLM_UNREACHABLE("No response found"); } -jlm::rvsdg::simple_node * +jlm::rvsdg::SimpleNode * replace_decouple( const jlm::llvm::lambda::node * lambda, - jlm::rvsdg::simple_node * decouple_request, + jlm::rvsdg::SimpleNode * decouple_request, jlm::rvsdg::output * resp) { JLM_ASSERT(dynamic_cast(&decouple_request->GetOperation())); @@ -299,11 +299,11 @@ replace_decouple( remove(decouple_response); auto nn = dynamic_cast(dload_out[0])->node(); - return dynamic_cast(nn); + return dynamic_cast(nn); } -jlm::rvsdg::simple_node * -replace_store(jlm::rvsdg::simple_node * orig) +jlm::rvsdg::SimpleNode * +replace_store(jlm::rvsdg::SimpleNode * orig) { auto addr = orig->input(0)->origin(); auto data = orig->input(1)->origin(); @@ -319,16 +319,16 @@ replace_store(jlm::rvsdg::simple_node * orig) orig->output(i)->divert_users(nn->output(i)); } remove(orig); - return dynamic_cast(nn); + return dynamic_cast(nn); } void gather_mem_nodes( jlm::rvsdg::Region * region, - std::vector & loadNodes, - std::vector & storeNodes, - std::vector & decoupleNodes, - std::unordered_set exclude) + std::vector & loadNodes, + std::vector & storeNodes, + std::vector & decoupleNodes, + std::unordered_set exclude) { for (auto & node : jlm::rvsdg::topdown_traverser(region)) { @@ -337,7 +337,7 @@ gather_mem_nodes( for (size_t n = 0; n < structnode->nsubregions(); n++) gather_mem_nodes(structnode->subregion(n), loadNodes, storeNodes, decoupleNodes, exclude); } - else if (auto simplenode = dynamic_cast(node)) + else if (auto simplenode = dynamic_cast(node)) { if (exclude.find(simplenode) != exclude.end()) { @@ -373,9 +373,9 @@ gather_mem_nodes( void TracePointer( jlm::rvsdg::output * output, - std::vector & loadNodes, - std::vector & storeNodes, - std::vector & decoupleNodes, + std::vector & loadNodes, + std::vector & storeNodes, + std::vector & decoupleNodes, std::unordered_set & visited) { if (!dynamic_cast(&output->type())) @@ -596,7 +596,7 @@ jlm::hls::MemoryConverter(jlm::llvm::RvsdgModule & rm) auto requestTypePtr = get_mem_req_type(jlm::rvsdg::bittype::Create(64), false); auto requestTypePtrWrite = get_mem_req_type(jlm::rvsdg::bittype::Create(64), true); - std::unordered_set accountedNodes; + std::unordered_set accountedNodes; for (auto & portNode : portNodes) { newArgumentTypes.push_back(responseTypePtr); @@ -612,9 +612,9 @@ jlm::hls::MemoryConverter(jlm::llvm::RvsdgModule & rm) accountedNodes.insert(std::get<1>(portNode).begin(), std::get<1>(portNode).end()); accountedNodes.insert(std::get<2>(portNode).begin(), std::get<2>(portNode).end()); } - std::vector unknownLoadNodes; - std::vector unknownStoreNodes; - std::vector unknownDecoupledNodes; + std::vector unknownLoadNodes; + std::vector unknownStoreNodes; + std::vector unknownDecoupledNodes; gather_mem_nodes( root, unknownLoadNodes, @@ -756,15 +756,15 @@ jlm::hls::ConnectRequestResponseMemPorts( const jlm::llvm::lambda::node * lambda, size_t argumentIndex, rvsdg::SubstitutionMap & smap, - const std::vector & originalLoadNodes, - const std::vector & originalStoreNodes, - const std::vector & originalDecoupledNodes) + const std::vector & originalLoadNodes, + const std::vector & originalStoreNodes, + const std::vector & originalDecoupledNodes) { // // We have the memory operations from the original lambda and need to lookup the corresponding // nodes in the new lambda // - std::vector loadNodes; + std::vector loadNodes; std::vector> loadTypes; for (auto loadNode : originalLoadNodes) { @@ -775,14 +775,14 @@ jlm::hls::ConnectRequestResponseMemPorts( &loadOutput->node()->GetOperation()); loadTypes.push_back(loadOp->GetLoadedType()); } - std::vector storeNodes; + std::vector storeNodes; for (auto storeNode : originalStoreNodes) { JLM_ASSERT(smap.contains(*storeNode->output(0))); auto storeOutput = dynamic_cast(smap.lookup(storeNode->output(0))); storeNodes.push_back(storeOutput->node()); } - std::vector decoupledNodes; + std::vector decoupledNodes; for (auto decoupledNode : originalDecoupledNodes) { JLM_ASSERT(smap.contains(*decoupledNode->output(0))); @@ -855,10 +855,10 @@ jlm::hls::ConnectRequestResponseMemPorts( return mem_req_op::create(loadAddresses, loadTypes, storeOperands, lambdaRegion)[0]; } -jlm::rvsdg::simple_node * +jlm::rvsdg::SimpleNode * jlm::hls::ReplaceLoad( rvsdg::SubstitutionMap & smap, - const jlm::rvsdg::simple_node * originalLoad, + const jlm::rvsdg::SimpleNode * originalLoad, jlm::rvsdg::output * response) { // We have the load from the original lambda since it is needed to update the smap @@ -891,11 +891,11 @@ jlm::hls::ReplaceLoad( replacedLoad->output(i)->divert_users(newLoad->output(i)); } remove(replacedLoad); - return dynamic_cast(newLoad); + return dynamic_cast(newLoad); } -jlm::rvsdg::simple_node * -jlm::hls::ReplaceStore(rvsdg::SubstitutionMap & smap, const jlm::rvsdg::simple_node * originalStore) +jlm::rvsdg::SimpleNode * +jlm::hls::ReplaceStore(rvsdg::SubstitutionMap & smap, const jlm::rvsdg::SimpleNode * originalStore) { // We have the store from the original lambda since it is needed to update the smap // We need the store in the new lambda such that we can replace it with a store node with explicit @@ -918,14 +918,14 @@ jlm::hls::ReplaceStore(rvsdg::SubstitutionMap & smap, const jlm::rvsdg::simple_n replacedStore->output(i)->divert_users(newStore->output(i)); } remove(replacedStore); - return dynamic_cast(newStore); + return dynamic_cast(newStore); } -jlm::rvsdg::simple_node * +jlm::rvsdg::SimpleNode * ReplaceDecouple( jlm::rvsdg::SubstitutionMap & smap, const jlm::llvm::lambda::node * lambda, - jlm::rvsdg::simple_node * originalDecoupleRequest, + jlm::rvsdg::SimpleNode * originalDecoupleRequest, jlm::rvsdg::output * response) { // We have the load from the original lambda since it is needed to update the smap @@ -966,5 +966,5 @@ ReplaceDecouple( remove(decoupledResponse); auto nodeOutput = dynamic_cast(decoupledLoadOutput[0])->node(); - return dynamic_cast(nodeOutput); + return dynamic_cast(nodeOutput); } diff --git a/jlm/hls/backend/rvsdg2rhls/mem-conv.hpp b/jlm/hls/backend/rvsdg2rhls/mem-conv.hpp index a8798afee..7cad9fc67 100644 --- a/jlm/hls/backend/rvsdg2rhls/mem-conv.hpp +++ b/jlm/hls/backend/rvsdg2rhls/mem-conv.hpp @@ -13,9 +13,9 @@ namespace jlm::hls { typedef std::vector, - std::vector, - std::vector>> + std::vector, + std::vector, + std::vector>> port_load_store_decouple; /** @@ -45,18 +45,18 @@ ConnectRequestResponseMemPorts( const llvm::lambda::node * lambda, size_t argumentIndex, rvsdg::SubstitutionMap & smap, - const std::vector & originalLoadNodes, - const std::vector & originalStoreNodes, - const std::vector & originalDecoupledNodes); + const std::vector & originalLoadNodes, + const std::vector & originalStoreNodes, + const std::vector & originalDecoupledNodes); -jlm::rvsdg::simple_node * +jlm::rvsdg::SimpleNode * ReplaceLoad( rvsdg::SubstitutionMap & smap, - const jlm::rvsdg::simple_node * originalLoad, + const jlm::rvsdg::SimpleNode * originalLoad, jlm::rvsdg::output * response); -jlm::rvsdg::simple_node * -ReplaceStore(rvsdg::SubstitutionMap & smap, const jlm::rvsdg::simple_node * originalStore); +jlm::rvsdg::SimpleNode * +ReplaceStore(rvsdg::SubstitutionMap & smap, const jlm::rvsdg::SimpleNode * originalStore); jlm::rvsdg::output * route_response(rvsdg::Region * target, jlm::rvsdg::output * response); diff --git a/jlm/hls/backend/rvsdg2rhls/mem-queue.cpp b/jlm/hls/backend/rvsdg2rhls/mem-queue.cpp index 7f2b49917..c23c7b7b2 100644 --- a/jlm/hls/backend/rvsdg2rhls/mem-queue.cpp +++ b/jlm/hls/backend/rvsdg2rhls/mem-queue.cpp @@ -38,8 +38,8 @@ dump_xml(const jlm::rvsdg::Region * region, const std::string & file_name) void find_load_store( jlm::rvsdg::output * op, - std::vector & load_nodes, - std::vector & store_nodes, + std::vector & load_nodes, + std::vector & store_nodes, std::unordered_set & visited) { if (!dynamic_cast(&op->type())) @@ -181,7 +181,7 @@ jlm::rvsdg::output * separate_load_edge( jlm::rvsdg::output * mem_edge, jlm::rvsdg::output * addr_edge, - jlm::rvsdg::simple_node ** load, + jlm::rvsdg::SimpleNode ** load, jlm::rvsdg::output ** new_mem_edge, std::vector & store_addresses, std::vector & store_dequeues, @@ -467,8 +467,8 @@ process_loops(jlm::rvsdg::output * state_edge) JLM_ASSERT(mem_edge_after_loop->nusers() == 1); auto common_user = *mem_edge_after_loop->begin(); - std::vector load_nodes; - std::vector store_nodes; + std::vector load_nodes; + std::vector store_nodes; std::unordered_set visited; // this is a hack to keep search within the loop visited.insert(mem_edge_after_loop); diff --git a/jlm/hls/backend/rvsdg2rhls/mem-sep.cpp b/jlm/hls/backend/rvsdg2rhls/mem-sep.cpp index c920be727..2d6ab9fa1 100644 --- a/jlm/hls/backend/rvsdg2rhls/mem-sep.cpp +++ b/jlm/hls/backend/rvsdg2rhls/mem-sep.cpp @@ -67,7 +67,7 @@ GetMemoryStateResult(const llvm::lambda::node & lambda) } void -gather_mem_nodes(rvsdg::Region * region, std::vector & mem_nodes) +gather_mem_nodes(rvsdg::Region * region, std::vector & mem_nodes) { for (auto & node : jlm::rvsdg::topdown_traverser(region)) { @@ -76,7 +76,7 @@ gather_mem_nodes(rvsdg::Region * region, std::vector for (size_t n = 0; n < structnode->nsubregions(); n++) gather_mem_nodes(structnode->subregion(n), mem_nodes); } - else if (auto simplenode = dynamic_cast(node)) + else if (auto simplenode = dynamic_cast(node)) { if (dynamic_cast(&simplenode->GetOperation())) { @@ -137,7 +137,7 @@ mem_sep_independent(rvsdg::Region * region) return; } auto state_user = *state_arg->begin(); - std::vector mem_nodes; + std::vector mem_nodes; gather_mem_nodes(lambda_region, mem_nodes); auto entry_states = jlm::llvm::LambdaEntryMemoryStateSplitOperation::Create(*state_arg, 1 + mem_nodes.size()); @@ -169,9 +169,9 @@ rvsdg::RegionResult * trace_edge( jlm::rvsdg::output * common_edge, jlm::rvsdg::output * new_edge, - std::vector & load_nodes, - const std::vector & store_nodes, - std::vector & decouple_nodes) + std::vector & load_nodes, + const std::vector & store_nodes, + std::vector & decouple_nodes) { // follows along common edge and routes new edge through the same regions // redirects the supplied loads, stores and decouples to the new edge diff --git a/jlm/hls/backend/rvsdg2rhls/memstate-conv.cpp b/jlm/hls/backend/rvsdg2rhls/memstate-conv.cpp index d3d0a7991..675b3ffbf 100644 --- a/jlm/hls/backend/rvsdg2rhls/memstate-conv.cpp +++ b/jlm/hls/backend/rvsdg2rhls/memstate-conv.cpp @@ -34,7 +34,7 @@ memstate_conv(rvsdg::Region * region) for (size_t n = 0; n < structnode->nsubregions(); n++) memstate_conv(structnode->subregion(n)); } - else if (auto simplenode = dynamic_cast(node)) + else if (auto simplenode = dynamic_cast(node)) { if (dynamic_cast( &simplenode->GetOperation()) diff --git a/jlm/hls/backend/rvsdg2rhls/merge-gamma.cpp b/jlm/hls/backend/rvsdg2rhls/merge-gamma.cpp index c9a63478f..dbe680b55 100644 --- a/jlm/hls/backend/rvsdg2rhls/merge-gamma.cpp +++ b/jlm/hls/backend/rvsdg2rhls/merge-gamma.cpp @@ -114,7 +114,7 @@ fix_match_inversion(rvsdg::GammaNode * old_gamma) { { 0, match->alternative(1) }, { 1, match->alternative(0) } }, default_alternative, match->nalternatives()); - auto new_match = rvsdg::simple_node::create_normalized( + auto new_match = rvsdg::SimpleNode::create_normalized( no->region(), op, { no->node()->input(0)->origin() })[0]; diff --git a/jlm/hls/backend/rvsdg2rhls/remove-redundant-buf.cpp b/jlm/hls/backend/rvsdg2rhls/remove-redundant-buf.cpp index c7f69d296..6291c5804 100644 --- a/jlm/hls/backend/rvsdg2rhls/remove-redundant-buf.cpp +++ b/jlm/hls/backend/rvsdg2rhls/remove-redundant-buf.cpp @@ -44,7 +44,7 @@ remove_redundant_buf(rvsdg::Region * region) remove_redundant_buf(structnode->subregion(n)); } } - else if (dynamic_cast(node)) + else if (dynamic_cast(node)) { if (auto buf = dynamic_cast(&node->GetOperation())) { diff --git a/jlm/hls/backend/rvsdg2rhls/remove-unused-state.cpp b/jlm/hls/backend/rvsdg2rhls/remove-unused-state.cpp index 80c30b844..a0fe61ce3 100644 --- a/jlm/hls/backend/rvsdg2rhls/remove-unused-state.cpp +++ b/jlm/hls/backend/rvsdg2rhls/remove-unused-state.cpp @@ -44,7 +44,7 @@ remove_unused_state(rvsdg::Region * region, bool can_remove_arguments) // exit will come before entry for (auto & node : jlm::rvsdg::bottomup_traverser(region)) { - if (auto simplenode = dynamic_cast(node)) + if (auto simplenode = dynamic_cast(node)) { if (dynamic_cast(&node->GetOperation())) { diff --git a/jlm/hls/backend/rvsdg2rhls/rvsdg2rhls.cpp b/jlm/hls/backend/rvsdg2rhls/rvsdg2rhls.cpp index 20e9534d2..16373bf09 100644 --- a/jlm/hls/backend/rvsdg2rhls/rvsdg2rhls.cpp +++ b/jlm/hls/backend/rvsdg2rhls/rvsdg2rhls.cpp @@ -164,7 +164,7 @@ inline_calls(rvsdg::Region * region) JLM_ASSERT(rvsdg::is(so->node())); auto ln = dynamic_cast(traced)->node(); llvm::inlineCall( - dynamic_cast(node), + dynamic_cast(node), dynamic_cast(ln)); // restart for this region inline_calls(region); @@ -209,7 +209,7 @@ convert_alloca(rvsdg::Region * region) else { llvm::ConstantAggregateZero cop(po->ValueType()); - cout = jlm::rvsdg::simple_node::create_normalized(db->subregion(), cop, {})[0]; + cout = jlm::rvsdg::SimpleNode::create_normalized(db->subregion(), cop, {})[0]; } auto delta = db->finalize(cout); jlm::llvm::GraphExport::Create(*delta, delta_name); diff --git a/jlm/hls/ir/hls.hpp b/jlm/hls/ir/hls.hpp index 8306c70f5..56ce261b1 100644 --- a/jlm/hls/ir/hls.hpp +++ b/jlm/hls/ir/hls.hpp @@ -64,7 +64,7 @@ class branch_op final : public rvsdg::SimpleOperation auto region = predicate.region(); branch_op op(ctl->nalternatives(), value.Type(), loop); - return jlm::rvsdg::simple_node::create_normalized(region, op, { &predicate, &value }); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, { &predicate, &value }); } bool loop; // only used for dot output @@ -153,7 +153,7 @@ class fork_op final : public rvsdg::SimpleOperation auto region = value.region(); fork_op op(nalternatives, value.Type(), isConstant); - return jlm::rvsdg::simple_node::create_normalized(region, op, { &value }); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, { &value }); } /** @@ -209,7 +209,7 @@ class merge_op final : public rvsdg::SimpleOperation auto region = alternatives.front()->region(); merge_op op(alternatives.size(), alternatives.front()->Type()); - return jlm::rvsdg::simple_node::create_normalized(region, op, alternatives); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, alternatives); } }; @@ -270,7 +270,7 @@ class mux_op final : public rvsdg::SimpleOperation operands.push_back(&predicate); operands.insert(operands.end(), alternatives.begin(), alternatives.end()); mux_op op(alternatives.size(), alternatives.front()->Type(), discarding, loop); - return jlm::rvsdg::simple_node::create_normalized(region, op, operands); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, operands); } bool discarding; @@ -320,7 +320,7 @@ class sink_op final : public rvsdg::SimpleOperation { auto region = value.region(); sink_op op(value.Type()); - return jlm::rvsdg::simple_node::create_normalized(region, op, { &value }); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, { &value }); } }; @@ -361,7 +361,7 @@ class predicate_buffer_op final : public rvsdg::SimpleOperation if (!ctl) throw util::error("Predicate needs to be a control type."); predicate_buffer_op op(ctl); - return jlm::rvsdg::simple_node::create_normalized(region, op, { &predicate }); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, { &predicate }); } }; @@ -404,7 +404,7 @@ class loop_constant_buffer_op final : public rvsdg::SimpleOperation if (!ctl) throw util::error("Predicate needs to be a control type."); loop_constant_buffer_op op(ctl, value.Type()); - return jlm::rvsdg::simple_node::create_normalized(region, op, { &predicate, &value }); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, { &predicate, &value }); } }; @@ -448,7 +448,7 @@ class buffer_op final : public rvsdg::SimpleOperation { auto region = value.region(); buffer_op op(value.Type(), capacity, pass_through); - return jlm::rvsdg::simple_node::create_normalized(region, op, { &value }); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, { &value }); } size_t capacity; @@ -525,7 +525,7 @@ class trigger_op final : public rvsdg::SimpleOperation auto region = value.region(); trigger_op op(value.Type()); - return jlm::rvsdg::simple_node::create_normalized(region, op, { &tg, &value }); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, { &tg, &value }); } }; @@ -580,7 +580,7 @@ class print_op final : public rvsdg::SimpleOperation auto region = value.region(); print_op op(value.Type()); - return jlm::rvsdg::simple_node::create_normalized(region, op, { &value }); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, { &value }); } }; @@ -945,7 +945,7 @@ class load_op final : public rvsdg::SimpleOperation inputs.push_back(&addr); inputs.insert(inputs.end(), states.begin(), states.end()); inputs.push_back(&load_result); - return jlm::rvsdg::simple_node::create_normalized(region, op, inputs); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, inputs); } [[nodiscard]] const llvm::PointerType & @@ -1027,7 +1027,7 @@ class addr_queue_op final : public rvsdg::SimpleOperation auto region = check.region(); auto pointerType = std::dynamic_pointer_cast(check.Type()); addr_queue_op op(pointerType, capacity, combinatorial); - return jlm::rvsdg::simple_node::create_normalized(region, op, { &check, &enq, &deq })[0]; + return jlm::rvsdg::SimpleNode::create_normalized(region, op, { &check, &enq, &deq })[0]; } bool combinatorial; @@ -1083,7 +1083,7 @@ class state_gate_op final : public rvsdg::SimpleOperation std::vector inputs; inputs.push_back(&addr); inputs.insert(inputs.end(), states.begin(), states.end()); - return jlm::rvsdg::simple_node::create_normalized(region, op, inputs); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, inputs); } }; @@ -1140,7 +1140,7 @@ class decoupled_load_op final : public rvsdg::SimpleOperation std::vector inputs; inputs.push_back(&addr); inputs.push_back(&load_result); - return jlm::rvsdg::simple_node::create_normalized(load_result.region(), op, inputs); + return jlm::rvsdg::SimpleNode::create_normalized(load_result.region(), op, inputs); } [[nodiscard]] const llvm::PointerType & @@ -1224,7 +1224,7 @@ class mem_resp_op final : public rvsdg::SimpleOperation // auto result_type = dynamic_cast(&result.type()); // JLM_ASSERT(result_type && result_type->nbits()==64); mem_resp_op op(output_types); - return jlm::rvsdg::simple_node::create_normalized(region, op, { &result }); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, { &result }); } }; @@ -1335,7 +1335,7 @@ class mem_req_op final : public rvsdg::SimpleOperation mem_req_op op(loadTypes, storeTypes); std::vector operands(load_operands); operands.insert(operands.end(), store_operands.begin(), store_operands.end()); - return jlm::rvsdg::simple_node::create_normalized(region, op, operands); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, operands); } size_t @@ -1428,7 +1428,7 @@ class store_op final : public rvsdg::SimpleOperation inputs.push_back(&addr); inputs.push_back(&value); inputs.insert(inputs.end(), states.begin(), states.end()); - return rvsdg::simple_node::create_normalized(value.region(), op, inputs); + return rvsdg::SimpleNode::create_normalized(value.region(), op, inputs); } [[nodiscard]] const llvm::PointerType & @@ -1486,7 +1486,7 @@ class local_mem_op final : public rvsdg::SimpleOperation create(std::shared_ptr at, rvsdg::Region * region) { local_mem_op op(std::move(at)); - return jlm::rvsdg::simple_node::create_normalized(region, op, {}); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, {}); } }; @@ -1534,7 +1534,7 @@ class local_mem_resp_op final : public rvsdg::SimpleOperation auto region = mem.region(); auto at = std::dynamic_pointer_cast(mem.Type()); local_mem_resp_op op(at, resp_count); - return jlm::rvsdg::simple_node::create_normalized(region, op, { &mem }); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, { &mem }); } }; @@ -1606,7 +1606,7 @@ class local_load_op final : public rvsdg::SimpleOperation inputs.push_back(&index); inputs.insert(inputs.end(), states.begin(), states.end()); inputs.push_back(&load_result); - return jlm::rvsdg::simple_node::create_normalized(region, op, inputs); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, inputs); } [[nodiscard]] std::shared_ptr @@ -1683,7 +1683,7 @@ class local_store_op final : public rvsdg::SimpleOperation inputs.push_back(&index); inputs.push_back(&value); inputs.insert(inputs.end(), states.begin(), states.end()); - return jlm::rvsdg::simple_node::create_normalized(region, op, inputs); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, inputs); } [[nodiscard]] const jlm::rvsdg::ValueType & @@ -1761,7 +1761,7 @@ class local_mem_req_op final : public rvsdg::SimpleOperation std::vector operands(1, &mem); operands.insert(operands.end(), load_operands.begin(), load_operands.end()); operands.insert(operands.end(), store_operands.begin(), store_operands.end()); - return jlm::rvsdg::simple_node::create_normalized(region, op, operands); + return jlm::rvsdg::SimpleNode::create_normalized(region, op, operands); } }; diff --git a/jlm/hls/opt/cne.cpp b/jlm/hls/opt/cne.cpp index d8a1f7a09..a4b7e53f6 100644 --- a/jlm/hls/opt/cne.cpp +++ b/jlm/hls/opt/cne.cpp @@ -427,7 +427,7 @@ mark(const rvsdg::StructuralNode * node, cnectx & ctx) } static void -mark(const jlm::rvsdg::simple_node * node, cnectx & ctx) +mark(const jlm::rvsdg::SimpleNode * node, cnectx & ctx) { if (node->ninputs() == 0) { @@ -470,7 +470,7 @@ mark(rvsdg::Region * region, cnectx & ctx) { for (const auto & node : jlm::rvsdg::topdown_traverser(region)) { - if (auto simple = dynamic_cast(node)) + if (auto simple = dynamic_cast(node)) mark(simple, ctx); else mark(static_cast(node), ctx); @@ -593,7 +593,7 @@ divert(rvsdg::Region * region, cnectx & ctx) { for (const auto & node : jlm::rvsdg::topdown_traverser(region)) { - if (auto simple = dynamic_cast(node)) + if (auto simple = dynamic_cast(node)) divert_outputs(simple, ctx); else divert(static_cast(node), ctx); diff --git a/jlm/hls/util/view.cpp b/jlm/hls/util/view.cpp index e0a5d3f87..6c9f276c1 100644 --- a/jlm/hls/util/view.cpp +++ b/jlm/hls/util/view.cpp @@ -236,7 +236,7 @@ structural_node_to_dot(rvsdg::StructuralNode * structuralNode) } std::string -simple_node_to_dot(jlm::rvsdg::simple_node * simpleNode) +simple_node_to_dot(jlm::rvsdg::SimpleNode * simpleNode) { auto SPACER = " \n"; auto name = get_dot_name(simpleNode); @@ -341,7 +341,7 @@ region_to_dot(rvsdg::Region * region) // nodes for (auto node : jlm::rvsdg::topdown_traverser(region)) { - if (auto simpleNode = dynamic_cast(node)) + if (auto simpleNode = dynamic_cast(node)) { auto node_dot = simple_node_to_dot(simpleNode); dot << node_dot; diff --git a/jlm/llvm/frontend/InterProceduralGraphConversion.cpp b/jlm/llvm/frontend/InterProceduralGraphConversion.cpp index 752d2a41e..10f6b4789 100644 --- a/jlm/llvm/frontend/InterProceduralGraphConversion.cpp +++ b/jlm/llvm/frontend/InterProceduralGraphConversion.cpp @@ -482,7 +482,7 @@ ConvertSelect( auto op = rvsdg::match_op(1, { { 1, 1 } }, 0, 2); auto p = variableMap.lookup(threeAddressCode.operand(0)); - auto predicate = rvsdg::simple_node::create_normalized(®ion, op, { p })[0]; + auto predicate = rvsdg::SimpleNode::create_normalized(®ion, op, { p })[0]; auto gamma = rvsdg::GammaNode::create(predicate, 2); auto ev1 = gamma->AddEntryVar(variableMap.lookup(threeAddressCode.operand(2))); @@ -571,7 +571,7 @@ ConvertThreeAddressCode( auto & simpleOperation = static_cast(threeAddressCode.operation()); - auto results = rvsdg::simple_node::create_normalized(®ion, simpleOperation, operands); + auto results = rvsdg::SimpleNode::create_normalized(®ion, simpleOperation, operands); JLM_ASSERT(results.size() == threeAddressCode.nresults()); for (size_t n = 0; n < threeAddressCode.nresults(); n++) diff --git a/jlm/llvm/ir/operators/GetElementPtr.hpp b/jlm/llvm/ir/operators/GetElementPtr.hpp index bfda9dd3c..8fc19d0cd 100644 --- a/jlm/llvm/ir/operators/GetElementPtr.hpp +++ b/jlm/llvm/ir/operators/GetElementPtr.hpp @@ -111,7 +111,7 @@ class GetElementPtrOperation final : public rvsdg::SimpleOperation std::vector operands(1, baseAddress); operands.insert(operands.end(), offsets.begin(), offsets.end()); - return rvsdg::simple_node::create_normalized(baseAddress->region(), operation, operands)[0]; + return rvsdg::SimpleNode::create_normalized(baseAddress->region(), operation, operands)[0]; } private: diff --git a/jlm/llvm/ir/operators/Load.cpp b/jlm/llvm/ir/operators/Load.cpp index aba6b444a..ca8b64ca1 100644 --- a/jlm/llvm/ir/operators/Load.cpp +++ b/jlm/llvm/ir/operators/Load.cpp @@ -15,7 +15,7 @@ namespace jlm::llvm const LoadOperation & LoadNode::GetOperation() const noexcept { - return *util::AssertedCast(&simple_node::GetOperation()); + return *util::AssertedCast(&SimpleNode::GetOperation()); } LoadNonVolatileOperation::~LoadNonVolatileOperation() noexcept = default; @@ -51,7 +51,7 @@ LoadNonVolatileOperation::NumMemoryStates() const noexcept const LoadNonVolatileOperation & LoadNonVolatileNode::GetOperation() const noexcept { - return *util::AssertedCast(&simple_node::GetOperation()); + return *util::AssertedCast(&SimpleNode::GetOperation()); } [[nodiscard]] LoadNode::MemoryStateInputRange diff --git a/jlm/llvm/ir/operators/Load.hpp b/jlm/llvm/ir/operators/Load.hpp index 129e4fde1..1d5f9d197 100644 --- a/jlm/llvm/ir/operators/Load.hpp +++ b/jlm/llvm/ir/operators/Load.hpp @@ -257,14 +257,14 @@ class LoadVolatileOperation final : public LoadOperation * @see LoadVolatileNode * @see LoadNonVolatileNode */ -class LoadNode : public rvsdg::simple_node +class LoadNode : public rvsdg::SimpleNode { protected: LoadNode( rvsdg::Region & region, const LoadOperation & operation, const std::vector & operands) - : simple_node(®ion, operation, operands) + : SimpleNode(®ion, operation, operands) {} public: diff --git a/jlm/llvm/ir/operators/MemCpy.hpp b/jlm/llvm/ir/operators/MemCpy.hpp index d7b431193..96c63bb3e 100644 --- a/jlm/llvm/ir/operators/MemCpy.hpp +++ b/jlm/llvm/ir/operators/MemCpy.hpp @@ -115,7 +115,7 @@ class MemCpyNonVolatileOperation final : public MemCpyOperation operands.insert(operands.end(), memoryStates.begin(), memoryStates.end()); MemCpyNonVolatileOperation operation(length->Type(), memoryStates.size()); - return rvsdg::simple_node::create_normalized(destination->region(), operation, operands); + return rvsdg::SimpleNode::create_normalized(destination->region(), operation, operands); } private: @@ -184,7 +184,7 @@ class MemCpyVolatileOperation final : public MemCpyOperation return tac::create(operation, operands); } - static rvsdg::simple_node & + static rvsdg::SimpleNode & CreateNode( rvsdg::output & destination, rvsdg::output & source, @@ -196,7 +196,7 @@ class MemCpyVolatileOperation final : public MemCpyOperation operands.insert(operands.end(), memoryStates.begin(), memoryStates.end()); MemCpyVolatileOperation operation(length.Type(), memoryStates.size()); - return *rvsdg::simple_node::create(destination.region(), operation, operands); + return *rvsdg::SimpleNode::create(destination.region(), operation, operands); } private: diff --git a/jlm/llvm/ir/operators/MemoryStateOperations.hpp b/jlm/llvm/ir/operators/MemoryStateOperations.hpp index 597b6ed03..a6bcd8d63 100644 --- a/jlm/llvm/ir/operators/MemoryStateOperations.hpp +++ b/jlm/llvm/ir/operators/MemoryStateOperations.hpp @@ -58,7 +58,7 @@ class MemoryStateMergeOperation final : public MemoryStateOperation MemoryStateMergeOperation operation(operands.size()); auto region = operands.front()->region(); - return rvsdg::simple_node::create_normalized(region, operation, operands)[0]; + return rvsdg::SimpleNode::create_normalized(region, operation, operands)[0]; } static std::unique_ptr @@ -103,7 +103,7 @@ class MemoryStateSplitOperation final : public MemoryStateOperation throw util::error("Insufficient number of results."); MemoryStateSplitOperation operation(numResults); - return rvsdg::simple_node::create_normalized(operand.region(), operation, { &operand }); + return rvsdg::SimpleNode::create_normalized(operand.region(), operation, { &operand }); } }; @@ -140,7 +140,7 @@ class LambdaEntryMemoryStateSplitOperation final : public MemoryStateOperation { auto region = output.region(); LambdaEntryMemoryStateSplitOperation operation(numResults); - return rvsdg::simple_node::create_normalized(region, operation, { &output }); + return rvsdg::SimpleNode::create_normalized(region, operation, { &output }); } }; @@ -176,7 +176,7 @@ class LambdaExitMemoryStateMergeOperation final : public MemoryStateOperation Create(rvsdg::Region & region, const std::vector & operands) { LambdaExitMemoryStateMergeOperation operation(operands.size()); - return *rvsdg::simple_node::create_normalized(®ion, operation, operands)[0]; + return *rvsdg::SimpleNode::create_normalized(®ion, operation, operands)[0]; } }; @@ -212,7 +212,7 @@ class CallEntryMemoryStateMergeOperation final : public MemoryStateOperation Create(rvsdg::Region & region, const std::vector & operands) { CallEntryMemoryStateMergeOperation operation(operands.size()); - return *rvsdg::simple_node::create_normalized(®ion, operation, operands)[0]; + return *rvsdg::SimpleNode::create_normalized(®ion, operation, operands)[0]; } }; @@ -249,7 +249,7 @@ class CallExitMemoryStateSplitOperation final : public MemoryStateOperation { auto region = output.region(); CallExitMemoryStateSplitOperation operation(numResults); - return rvsdg::simple_node::create_normalized(region, operation, { &output }); + return rvsdg::SimpleNode::create_normalized(region, operation, { &output }); } }; diff --git a/jlm/llvm/ir/operators/Store.cpp b/jlm/llvm/ir/operators/Store.cpp index d1cecd9ba..a3713bac7 100644 --- a/jlm/llvm/ir/operators/Store.cpp +++ b/jlm/llvm/ir/operators/Store.cpp @@ -14,7 +14,7 @@ namespace jlm::llvm const StoreOperation & StoreNode::GetOperation() const noexcept { - return *util::AssertedCast(&simple_node::GetOperation()); + return *util::AssertedCast(&SimpleNode::GetOperation()); } StoreNonVolatileOperation::~StoreNonVolatileOperation() noexcept = default; diff --git a/jlm/llvm/ir/operators/Store.hpp b/jlm/llvm/ir/operators/Store.hpp index 891f2a582..85b6aeec9 100644 --- a/jlm/llvm/ir/operators/Store.hpp +++ b/jlm/llvm/ir/operators/Store.hpp @@ -212,14 +212,14 @@ class StoreNonVolatileOperation final : public StoreOperation * @see StoreVolatileNode * @see StoreNonVolatileNode */ -class StoreNode : public rvsdg::simple_node +class StoreNode : public rvsdg::SimpleNode { protected: StoreNode( rvsdg::Region & region, const StoreOperation & operation, const std::vector & operands) - : simple_node(®ion, operation, operands) + : SimpleNode(®ion, operation, operands) {} public: diff --git a/jlm/llvm/ir/operators/alloca.hpp b/jlm/llvm/ir/operators/alloca.hpp index 8236ddc43..590fb5e8e 100644 --- a/jlm/llvm/ir/operators/alloca.hpp +++ b/jlm/llvm/ir/operators/alloca.hpp @@ -94,7 +94,7 @@ class alloca_op final : public rvsdg::SimpleOperation throw jlm::util::error("expected bits type."); alloca_op op(std::move(allocatedType), std::move(bt), alignment); - return rvsdg::simple_node::create_normalized(size->region(), op, { size }); + return rvsdg::SimpleNode::create_normalized(size->region(), op, { size }); } private: diff --git a/jlm/llvm/ir/operators/call.hpp b/jlm/llvm/ir/operators/call.hpp index 2bef541d4..f3214509b 100644 --- a/jlm/llvm/ir/operators/call.hpp +++ b/jlm/llvm/ir/operators/call.hpp @@ -285,21 +285,21 @@ class CallTypeClassifier final /** \brief Call node * */ -class CallNode final : public jlm::rvsdg::simple_node +class CallNode final : public jlm::rvsdg::SimpleNode { private: CallNode( rvsdg::Region & region, const CallOperation & operation, const std::vector & operands) - : simple_node(®ion, operation, operands) + : SimpleNode(®ion, operation, operands) {} public: [[nodiscard]] const CallOperation & GetOperation() const noexcept override { - return *jlm::util::AssertedCast(&simple_node::GetOperation()); + return *jlm::util::AssertedCast(&SimpleNode::GetOperation()); } /** @@ -418,11 +418,11 @@ class CallNode final : public jlm::rvsdg::simple_node * @see GetMemoryStateInput() * @see GetMemoryStateExitSplit() */ - [[nodiscard]] static rvsdg::simple_node * + [[nodiscard]] static rvsdg::SimpleNode * GetMemoryStateEntryMerge(const CallNode & callNode) noexcept { auto node = rvsdg::output::GetNode(*callNode.GetMemoryStateInput()->origin()); - return is(node) ? dynamic_cast(node) + return is(node) ? dynamic_cast(node) : nullptr; } @@ -435,7 +435,7 @@ class CallNode final : public jlm::rvsdg::simple_node * @see GetMemoryStateOutput() * @see GetMemoryStateEntryMerge() */ - [[nodiscard]] static rvsdg::simple_node * + [[nodiscard]] static rvsdg::SimpleNode * GetMemoryStateExitSplit(const CallNode & callNode) noexcept { // If a memory state exit split node is present, then we would expect the node to be the only @@ -444,7 +444,7 @@ class CallNode final : public jlm::rvsdg::simple_node return nullptr; auto node = rvsdg::node_input::GetNode(**callNode.GetMemoryStateOutput()->begin()); - return is(node) ? dynamic_cast(node) + return is(node) ? dynamic_cast(node) : nullptr; } diff --git a/jlm/llvm/ir/operators/lambda.cpp b/jlm/llvm/ir/operators/lambda.cpp index f0471ab59..f0dbabc58 100644 --- a/jlm/llvm/ir/operators/lambda.cpp +++ b/jlm/llvm/ir/operators/lambda.cpp @@ -134,17 +134,17 @@ node::GetMemoryStateRegionResult() const noexcept return *result; } -rvsdg::simple_node * +rvsdg::SimpleNode * node::GetMemoryStateExitMerge(const lambda::node & lambdaNode) noexcept { auto & result = lambdaNode.GetMemoryStateRegionResult(); auto node = rvsdg::output::GetNode(*result.origin()); - return is(node) ? dynamic_cast(node) + return is(node) ? dynamic_cast(node) : nullptr; } -rvsdg::simple_node * +rvsdg::SimpleNode * node::GetMemoryStateEntrySplit(const lambda::node & lambdaNode) noexcept { auto & argument = lambdaNode.GetMemoryStateRegionArgument(); @@ -155,7 +155,7 @@ node::GetMemoryStateEntrySplit(const lambda::node & lambdaNode) noexcept return nullptr; auto node = rvsdg::node_input::GetNode(**argument.begin()); - return is(node) ? dynamic_cast(node) + return is(node) ? dynamic_cast(node) : nullptr; } diff --git a/jlm/llvm/ir/operators/lambda.hpp b/jlm/llvm/ir/operators/lambda.hpp index b9a3a579b..67b939942 100644 --- a/jlm/llvm/ir/operators/lambda.hpp +++ b/jlm/llvm/ir/operators/lambda.hpp @@ -342,7 +342,7 @@ class node final : public rvsdg::StructuralNode * * @see GetMemoryStateExitMerge() */ - static rvsdg::simple_node * + static rvsdg::SimpleNode * GetMemoryStateEntrySplit(const lambda::node & lambdaNode) noexcept; /** @@ -354,7 +354,7 @@ class node final : public rvsdg::StructuralNode * * @see GetMemoryStateEntrySplit() */ - [[nodiscard]] static rvsdg::simple_node * + [[nodiscard]] static rvsdg::SimpleNode * GetMemoryStateExitMerge(const lambda::node & lambdaNode) noexcept; /** diff --git a/jlm/llvm/ir/operators/operators.hpp b/jlm/llvm/ir/operators/operators.hpp index fee9c06b7..7d52a8181 100644 --- a/jlm/llvm/ir/operators/operators.hpp +++ b/jlm/llvm/ir/operators/operators.hpp @@ -473,7 +473,7 @@ class ConstantPointerNullOperation final : public rvsdg::SimpleOperation Create(rvsdg::Region * region, std::shared_ptr type) { ConstantPointerNullOperation operation(CheckAndExtractType(type)); - return jlm::rvsdg::simple_node::create_normalized(region, operation, {})[0]; + return jlm::rvsdg::SimpleNode::create_normalized(region, operation, {})[0]; } private: @@ -563,7 +563,7 @@ class bits2ptr_op final : public jlm::rvsdg::unary_op throw jlm::util::error("expected pointer type."); bits2ptr_op op(ot, pt); - return jlm::rvsdg::simple_node::create_normalized(operand->region(), op, { operand })[0]; + return jlm::rvsdg::SimpleNode::create_normalized(operand->region(), op, { operand })[0]; } }; @@ -694,9 +694,7 @@ class ConstantDataArray final : public rvsdg::SimpleOperation } ConstantDataArray operation(std::move(valueType), elements.size()); - return jlm::rvsdg::simple_node::create_normalized( - elements[0]->region(), - operation, + return jlm::rvsdg::SimpleNode::create_normalized(elements[0]->region(), operation, elements)[0]; } }; @@ -848,7 +846,7 @@ class zext_op final : public jlm::rvsdg::unary_op auto resultBitType = CheckAndExtractBitType(resultType); zext_op operation(std::move(operandBitType), std::move(resultBitType)); - return *rvsdg::simple_node::create_normalized(operand.region(), operation, { &operand })[0]; + return *rvsdg::SimpleNode::create_normalized(operand.region(), operation, { &operand })[0]; } private: @@ -1042,7 +1040,7 @@ class UndefValueOperation final : public rvsdg::SimpleOperation Create(rvsdg::Region & region, std::shared_ptr type) { UndefValueOperation operation(std::move(type)); - return jlm::rvsdg::simple_node::create_normalized(®ion, operation, {})[0]; + return jlm::rvsdg::SimpleNode::create_normalized(®ion, operation, {})[0]; } static std::unique_ptr @@ -1125,7 +1123,7 @@ class PoisonValueOperation final : public rvsdg::SimpleOperation auto valueType = CheckAndConvertType(type); PoisonValueOperation operation(std::move(valueType)); - return jlm::rvsdg::simple_node::create_normalized(region, operation, {})[0]; + return jlm::rvsdg::SimpleNode::create_normalized(region, operation, {})[0]; } private: @@ -1478,7 +1476,7 @@ class valist_op final : public rvsdg::SimpleOperation operandTypes.emplace_back(operand->Type()); valist_op operation(std::move(operandTypes)); - return jlm::rvsdg::simple_node::create_normalized(®ion, operation, operands)[0]; + return jlm::rvsdg::SimpleNode::create_normalized(®ion, operation, operands)[0]; } }; @@ -1544,7 +1542,7 @@ class bitcast_op final : public jlm::rvsdg::unary_op auto pair = check_types(operand->Type(), rtype); bitcast_op op(pair.first, pair.second); - return jlm::rvsdg::simple_node::create_normalized(operand->region(), op, { operand })[0]; + return jlm::rvsdg::SimpleNode::create_normalized(operand->region(), op, { operand })[0]; } private: @@ -1613,7 +1611,7 @@ class ConstantStruct final : public rvsdg::SimpleOperation auto structType = CheckAndExtractStructType(std::move(resultType)); ConstantStruct operation(std::move(structType)); - return *rvsdg::simple_node::create_normalized(®ion, operation, operands)[0]; + return *rvsdg::SimpleNode::create_normalized(®ion, operation, operands)[0]; } private: @@ -1723,7 +1721,7 @@ class trunc_op final : public jlm::rvsdg::unary_op throw jlm::util::error("expected bits type."); trunc_op op(std::move(ot), jlm::rvsdg::bittype::Create(ndstbits)); - return jlm::rvsdg::simple_node::create_normalized(operand->region(), op, { operand })[0]; + return jlm::rvsdg::SimpleNode::create_normalized(operand->region(), op, { operand })[0]; } }; @@ -1907,7 +1905,7 @@ class ConstantArray final : public rvsdg::SimpleOperation } ConstantArray operation(valueType, operands.size()); - return rvsdg::simple_node::create_normalized(operands[0]->region(), operation, operands)[0]; + return rvsdg::SimpleNode::create_normalized(operands[0]->region(), operation, operands)[0]; } }; @@ -1948,7 +1946,7 @@ class ConstantAggregateZero final : public rvsdg::SimpleOperation Create(rvsdg::Region & region, std::shared_ptr type) { ConstantAggregateZero operation(std::move(type)); - return jlm::rvsdg::simple_node::create_normalized(®ion, operation, {})[0]; + return jlm::rvsdg::SimpleNode::create_normalized(®ion, operation, {})[0]; } }; @@ -2508,7 +2506,7 @@ class malloc_op final : public rvsdg::SimpleOperation throw jlm::util::error("expected bits type."); malloc_op op(std::move(bt)); - return jlm::rvsdg::simple_node::create_normalized(size->region(), op, { size }); + return jlm::rvsdg::SimpleNode::create_normalized(size->region(), op, { size }); } }; @@ -2562,7 +2560,7 @@ class FreeOperation final : public rvsdg::SimpleOperation operands.push_back(iOState); FreeOperation operation(memoryStates.size()); - return jlm::rvsdg::simple_node::create_normalized(pointer->region(), operation, operands); + return jlm::rvsdg::SimpleNode::create_normalized(pointer->region(), operation, operands); } private: diff --git a/jlm/llvm/ir/operators/sext.cpp b/jlm/llvm/ir/operators/sext.cpp index d19651345..e382a974f 100644 --- a/jlm/llvm/ir/operators/sext.cpp +++ b/jlm/llvm/ir/operators/sext.cpp @@ -44,7 +44,7 @@ perform_bitunary_reduction(const sext_op & op, rvsdg::output * operand) auto uop = static_cast(&unary->GetOperation()); auto output = sext_op::create(op.ndstbits(), unary->input(0)->origin()); - return rvsdg::simple_node::create_normalized(region, *uop->create(op.ndstbits()), { output })[0]; + return rvsdg::SimpleNode::create_normalized(region, *uop->create(op.ndstbits()), { output })[0]; } static rvsdg::output * @@ -59,9 +59,7 @@ perform_bitbinary_reduction(const sext_op & op, rvsdg::output * operand) auto op1 = sext_op::create(op.ndstbits(), binary->input(0)->origin()); auto op2 = sext_op::create(op.ndstbits(), binary->input(1)->origin()); - return rvsdg::simple_node::create_normalized( - region, - *bop->create(op.ndstbits()), + return rvsdg::SimpleNode::create_normalized(region, *bop->create(op.ndstbits()), { op1, op2 })[0]; } diff --git a/jlm/llvm/ir/operators/sext.hpp b/jlm/llvm/ir/operators/sext.hpp index 3bf1af6e5..f8a851fdf 100644 --- a/jlm/llvm/ir/operators/sext.hpp +++ b/jlm/llvm/ir/operators/sext.hpp @@ -96,7 +96,7 @@ class sext_op final : public rvsdg::unary_op throw jlm::util::error("expected bits type."); sext_op op(std::move(ot), rvsdg::bittype::Create(ndstbits)); - return rvsdg::simple_node::create_normalized(operand->region(), op, { operand })[0]; + return rvsdg::SimpleNode::create_normalized(operand->region(), op, { operand })[0]; } }; diff --git a/jlm/llvm/opt/DeadNodeElimination.cpp b/jlm/llvm/opt/DeadNodeElimination.cpp index 8ef58b653..660667c11 100644 --- a/jlm/llvm/opt/DeadNodeElimination.cpp +++ b/jlm/llvm/opt/DeadNodeElimination.cpp @@ -60,7 +60,7 @@ class DeadNodeElimination::Context final bool IsAlive(const rvsdg::Node & node) const noexcept { - if (auto simpleNode = dynamic_cast(&node)) + if (auto simpleNode = dynamic_cast(&node)) { return SimpleNodes_.Contains(simpleNode); } @@ -83,7 +83,7 @@ class DeadNodeElimination::Context final } private: - util::HashSet SimpleNodes_; + util::HashSet SimpleNodes_; util::HashSet Outputs_; }; diff --git a/jlm/llvm/opt/alias-analyses/Andersen.cpp b/jlm/llvm/opt/alias-analyses/Andersen.cpp index 0873b6609..bea16c108 100644 --- a/jlm/llvm/opt/alias-analyses/Andersen.cpp +++ b/jlm/llvm/opt/alias-analyses/Andersen.cpp @@ -608,7 +608,7 @@ class Andersen::Statistics final : public util::Statistics }; void -Andersen::AnalyzeSimpleNode(const rvsdg::simple_node & node) +Andersen::AnalyzeSimpleNode(const rvsdg::SimpleNode & node) { const auto & op = node.GetOperation(); @@ -661,7 +661,7 @@ Andersen::AnalyzeSimpleNode(const rvsdg::simple_node & node) } void -Andersen::AnalyzeAlloca(const rvsdg::simple_node & node) +Andersen::AnalyzeAlloca(const rvsdg::SimpleNode & node) { const auto allocaOp = util::AssertedCast(&node.GetOperation()); @@ -674,7 +674,7 @@ Andersen::AnalyzeAlloca(const rvsdg::simple_node & node) } void -Andersen::AnalyzeMalloc(const rvsdg::simple_node & node) +Andersen::AnalyzeMalloc(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -747,7 +747,7 @@ Andersen::AnalyzeCall(const CallNode & callNode) } void -Andersen::AnalyzeGep(const rvsdg::simple_node & node) +Andersen::AnalyzeGep(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -762,7 +762,7 @@ Andersen::AnalyzeGep(const rvsdg::simple_node & node) } void -Andersen::AnalyzeBitcast(const rvsdg::simple_node & node) +Andersen::AnalyzeBitcast(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -781,7 +781,7 @@ Andersen::AnalyzeBitcast(const rvsdg::simple_node & node) } void -Andersen::AnalyzeBits2ptr(const rvsdg::simple_node & node) +Andersen::AnalyzeBits2ptr(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); const auto & output = *node.output(0); @@ -795,7 +795,7 @@ Andersen::AnalyzeBits2ptr(const rvsdg::simple_node & node) } void -Andersen::AnalyzePtr2bits(const rvsdg::simple_node & node) +Andersen::AnalyzePtr2bits(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); const auto & inputRegister = *node.input(0)->origin(); @@ -807,7 +807,7 @@ Andersen::AnalyzePtr2bits(const rvsdg::simple_node & node) } void -Andersen::AnalyzeConstantPointerNull(const rvsdg::simple_node & node) +Andersen::AnalyzeConstantPointerNull(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); const auto & output = *node.output(0); @@ -819,7 +819,7 @@ Andersen::AnalyzeConstantPointerNull(const rvsdg::simple_node & node) } void -Andersen::AnalyzeUndef(const rvsdg::simple_node & node) +Andersen::AnalyzeUndef(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); const auto & output = *node.output(0); @@ -833,7 +833,7 @@ Andersen::AnalyzeUndef(const rvsdg::simple_node & node) } void -Andersen::AnalyzeMemcpy(const rvsdg::simple_node & node) +Andersen::AnalyzeMemcpy(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -855,7 +855,7 @@ Andersen::AnalyzeMemcpy(const rvsdg::simple_node & node) } void -Andersen::AnalyzeConstantArray(const rvsdg::simple_node & node) +Andersen::AnalyzeConstantArray(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -877,7 +877,7 @@ Andersen::AnalyzeConstantArray(const rvsdg::simple_node & node) } void -Andersen::AnalyzeConstantStruct(const rvsdg::simple_node & node) +Andersen::AnalyzeConstantStruct(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -900,7 +900,7 @@ Andersen::AnalyzeConstantStruct(const rvsdg::simple_node & node) } void -Andersen::AnalyzeConstantAggregateZero(const rvsdg::simple_node & node) +Andersen::AnalyzeConstantAggregateZero(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); auto & output = *node.output(0); @@ -914,7 +914,7 @@ Andersen::AnalyzeConstantAggregateZero(const rvsdg::simple_node & node) } void -Andersen::AnalyzeExtractValue(const rvsdg::simple_node & node) +Andersen::AnalyzeExtractValue(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -929,7 +929,7 @@ Andersen::AnalyzeExtractValue(const rvsdg::simple_node & node) } void -Andersen::AnalyzeValist(const rvsdg::simple_node & node) +Andersen::AnalyzeValist(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -1182,7 +1182,7 @@ Andersen::AnalyzeRegion(rvsdg::Region & region) // PointerObjects for any of the node's outputs of pointer type for (const auto node : traverser) { - if (auto simpleNode = dynamic_cast(node)) + if (auto simpleNode = dynamic_cast(node)) AnalyzeSimpleNode(*simpleNode); else if (auto structuralNode = dynamic_cast(node)) AnalyzeStructuralNode(*structuralNode); diff --git a/jlm/llvm/opt/alias-analyses/Andersen.hpp b/jlm/llvm/opt/alias-analyses/Andersen.hpp index f35a5b078..4978a3ed6 100644 --- a/jlm/llvm/opt/alias-analyses/Andersen.hpp +++ b/jlm/llvm/opt/alias-analyses/Andersen.hpp @@ -348,13 +348,13 @@ class Andersen final : public AliasAnalysis AnalyzeRegion(rvsdg::Region & region); void - AnalyzeSimpleNode(const rvsdg::simple_node & node); + AnalyzeSimpleNode(const rvsdg::SimpleNode & node); void - AnalyzeAlloca(const rvsdg::simple_node & node); + AnalyzeAlloca(const rvsdg::SimpleNode & node); void - AnalyzeMalloc(const rvsdg::simple_node & node); + AnalyzeMalloc(const rvsdg::SimpleNode & node); void AnalyzeLoad(const LoadNode & loadNode); @@ -366,40 +366,40 @@ class Andersen final : public AliasAnalysis AnalyzeCall(const CallNode & callNode); void - AnalyzeGep(const rvsdg::simple_node & node); + AnalyzeGep(const rvsdg::SimpleNode & node); void - AnalyzeBitcast(const rvsdg::simple_node & node); + AnalyzeBitcast(const rvsdg::SimpleNode & node); void - AnalyzeBits2ptr(const rvsdg::simple_node & node); + AnalyzeBits2ptr(const rvsdg::SimpleNode & node); void - AnalyzePtr2bits(const rvsdg::simple_node & node); + AnalyzePtr2bits(const rvsdg::SimpleNode & node); void - AnalyzeConstantPointerNull(const rvsdg::simple_node & node); + AnalyzeConstantPointerNull(const rvsdg::SimpleNode & node); void - AnalyzeUndef(const rvsdg::simple_node & node); + AnalyzeUndef(const rvsdg::SimpleNode & node); void - AnalyzeMemcpy(const rvsdg::simple_node & node); + AnalyzeMemcpy(const rvsdg::SimpleNode & node); void - AnalyzeConstantArray(const rvsdg::simple_node & node); + AnalyzeConstantArray(const rvsdg::SimpleNode & node); void - AnalyzeConstantStruct(const rvsdg::simple_node & node); + AnalyzeConstantStruct(const rvsdg::SimpleNode & node); void - AnalyzeConstantAggregateZero(const rvsdg::simple_node & node); + AnalyzeConstantAggregateZero(const rvsdg::SimpleNode & node); void - AnalyzeExtractValue(const rvsdg::simple_node & node); + AnalyzeExtractValue(const rvsdg::SimpleNode & node); void - AnalyzeValist(const rvsdg::simple_node & node); + AnalyzeValist(const rvsdg::SimpleNode & node); void AnalyzeStructuralNode(const rvsdg::StructuralNode & node); diff --git a/jlm/llvm/opt/alias-analyses/MemoryStateEncoder.cpp b/jlm/llvm/opt/alias-analyses/MemoryStateEncoder.cpp index b702221f3..1902e8c57 100644 --- a/jlm/llvm/opt/alias-analyses/MemoryStateEncoder.cpp +++ b/jlm/llvm/opt/alias-analyses/MemoryStateEncoder.cpp @@ -492,7 +492,7 @@ MemoryStateEncoder::EncodeRegion(rvsdg::Region & region) topdown_traverser traverser(®ion); for (auto & node : traverser) { - if (auto simpleNode = dynamic_cast(node)) + if (auto simpleNode = dynamic_cast(node)) { EncodeSimpleNode(*simpleNode); } @@ -537,7 +537,7 @@ MemoryStateEncoder::EncodeStructuralNode(rvsdg::StructuralNode & structuralNode) } void -MemoryStateEncoder::EncodeSimpleNode(const rvsdg::simple_node & simpleNode) +MemoryStateEncoder::EncodeSimpleNode(const rvsdg::SimpleNode & simpleNode) { if (is(&simpleNode)) { @@ -579,7 +579,7 @@ MemoryStateEncoder::EncodeSimpleNode(const rvsdg::simple_node & simpleNode) } void -MemoryStateEncoder::EncodeAlloca(const rvsdg::simple_node & allocaNode) +MemoryStateEncoder::EncodeAlloca(const rvsdg::SimpleNode & allocaNode) { JLM_ASSERT(is(&allocaNode)); @@ -602,7 +602,7 @@ MemoryStateEncoder::EncodeAlloca(const rvsdg::simple_node & allocaNode) } void -MemoryStateEncoder::EncodeMalloc(const rvsdg::simple_node & mallocNode) +MemoryStateEncoder::EncodeMalloc(const rvsdg::SimpleNode & mallocNode) { JLM_ASSERT(is(&mallocNode)); auto & stateMap = Context_->GetRegionalizedStateMap(); @@ -657,7 +657,7 @@ MemoryStateEncoder::EncodeStore(const StoreNode & storeNode) } void -MemoryStateEncoder::EncodeFree(const rvsdg::simple_node & freeNode) +MemoryStateEncoder::EncodeFree(const rvsdg::SimpleNode & freeNode) { JLM_ASSERT(is(&freeNode)); auto & stateMap = Context_->GetRegionalizedStateMap(); @@ -725,7 +725,7 @@ MemoryStateEncoder::EncodeCallExit(const CallNode & callNode) } void -MemoryStateEncoder::EncodeMemcpy(const rvsdg::simple_node & memcpyNode) +MemoryStateEncoder::EncodeMemcpy(const rvsdg::SimpleNode & memcpyNode) { JLM_ASSERT(is(&memcpyNode)); auto & stateMap = Context_->GetRegionalizedStateMap(); @@ -989,7 +989,7 @@ MemoryStateEncoder::ReplaceStoreNode( std::vector MemoryStateEncoder::ReplaceMemcpyNode( - const rvsdg::simple_node & memcpyNode, + const rvsdg::SimpleNode & memcpyNode, const std::vector & memoryStates) { JLM_ASSERT(is(&memcpyNode)); @@ -1022,7 +1022,7 @@ MemoryStateEncoder::ReplaceMemcpyNode( } bool -MemoryStateEncoder::ShouldHandle(const rvsdg::simple_node & simpleNode) noexcept +MemoryStateEncoder::ShouldHandle(const rvsdg::SimpleNode & simpleNode) noexcept { for (size_t n = 0; n < simpleNode.ninputs(); n++) { diff --git a/jlm/llvm/opt/alias-analyses/MemoryStateEncoder.hpp b/jlm/llvm/opt/alias-analyses/MemoryStateEncoder.hpp index 6d08583e0..9929f2bb2 100644 --- a/jlm/llvm/opt/alias-analyses/MemoryStateEncoder.hpp +++ b/jlm/llvm/opt/alias-analyses/MemoryStateEncoder.hpp @@ -14,7 +14,7 @@ namespace rvsdg class GammaNode; class output; class Region; -class simple_node; +class SimpleNode; class StructuralNode; class ThetaNode; class ThetaOutput; @@ -101,13 +101,13 @@ class MemoryStateEncoder final EncodeStructuralNode(rvsdg::StructuralNode & structuralNode); void - EncodeSimpleNode(const rvsdg::simple_node & simpleNode); + EncodeSimpleNode(const rvsdg::SimpleNode & simpleNode); void - EncodeAlloca(const rvsdg::simple_node & allocaNode); + EncodeAlloca(const rvsdg::SimpleNode & allocaNode); void - EncodeMalloc(const rvsdg::simple_node & mallocNode); + EncodeMalloc(const rvsdg::SimpleNode & mallocNode); void EncodeLoad(const LoadNode & loadNode); @@ -116,7 +116,7 @@ class MemoryStateEncoder final EncodeStore(const StoreNode & storeNode); void - EncodeFree(const rvsdg::simple_node & freeNode); + EncodeFree(const rvsdg::SimpleNode & freeNode); void EncodeCall(const CallNode & callNode); @@ -128,7 +128,7 @@ class MemoryStateEncoder final EncodeCallExit(const CallNode & callNode); void - EncodeMemcpy(const rvsdg::simple_node & memcpyNode); + EncodeMemcpy(const rvsdg::SimpleNode & memcpyNode); void EncodeLambda(const lambda::node & lambda); @@ -194,24 +194,24 @@ class MemoryStateEncoder final * the outputs of \p memcpyNode are redirected to the respective outputs of the newly created * copy. * - * @param memcpyNode A rvsdg::simple_node representing a MemCpyOperation. + * @param memcpyNode A rvsdg::SimpleNode representing a MemCpyOperation. * @param memoryStates The memory states the new memcpy node should consume. * * @return A vector with the memory states of the newly created copy. */ [[nodiscard]] static std::vector ReplaceMemcpyNode( - const rvsdg::simple_node & memcpyNode, + const rvsdg::SimpleNode & memcpyNode, const std::vector & memoryStates); /** * Determines whether \p simpleNode should be handled by the MemoryStateEncoder. * - * @param simpleNode A simple_node. + * @param simpleNode A SimpleNode. * @return True, if \p simpleNode should be handled, otherwise false. */ [[nodiscard]] static bool - ShouldHandle(const rvsdg::simple_node & simpleNode) noexcept; + ShouldHandle(const rvsdg::SimpleNode & simpleNode) noexcept; std::unique_ptr Context_; }; diff --git a/jlm/llvm/opt/alias-analyses/RegionAwareMemoryNodeProvider.cpp b/jlm/llvm/opt/alias-analyses/RegionAwareMemoryNodeProvider.cpp index 50c510693..e76cdc54f 100644 --- a/jlm/llvm/opt/alias-analyses/RegionAwareMemoryNodeProvider.cpp +++ b/jlm/llvm/opt/alias-analyses/RegionAwareMemoryNodeProvider.cpp @@ -168,7 +168,7 @@ class RegionSummary final return MemoryNodes_; } - [[nodiscard]] const util::HashSet & + [[nodiscard]] const util::HashSet & GetUnknownMemoryNodeReferences() const noexcept { return UnknownMemoryNodeReferences_; @@ -199,7 +199,7 @@ class RegionSummary final } void - AddUnknownMemoryNodeReferences(const util::HashSet & nodes) + AddUnknownMemoryNodeReferences(const util::HashSet & nodes) { UnknownMemoryNodeReferences_.UnionWith(nodes); } @@ -250,7 +250,7 @@ class RegionSummary final private: const rvsdg::Region * Region_; util::HashSet MemoryNodes_; - util::HashSet UnknownMemoryNodeReferences_; + util::HashSet UnknownMemoryNodeReferences_; util::HashSet RecursiveCalls_; util::HashSet NonRecursiveCalls_; @@ -685,7 +685,7 @@ RegionAwareMemoryNodeProvider::AnnotateRegion(rvsdg::Region & region) { AnnotateStructuralNode(*structuralNode); } - else if (auto simpleNode = dynamic_cast(&node)) + else if (auto simpleNode = dynamic_cast(&node)) { AnnotateSimpleNode(*simpleNode); } @@ -697,7 +697,7 @@ RegionAwareMemoryNodeProvider::AnnotateRegion(rvsdg::Region & region) } void -RegionAwareMemoryNodeProvider::AnnotateSimpleNode(const rvsdg::simple_node & simpleNode) +RegionAwareMemoryNodeProvider::AnnotateSimpleNode(const rvsdg::SimpleNode & simpleNode) { if (auto loadNode = dynamic_cast(&simpleNode)) { @@ -746,7 +746,7 @@ RegionAwareMemoryNodeProvider::AnnotateStore(const StoreNode & storeNode) } void -RegionAwareMemoryNodeProvider::AnnotateAlloca(const rvsdg::simple_node & allocaNode) +RegionAwareMemoryNodeProvider::AnnotateAlloca(const rvsdg::SimpleNode & allocaNode) { JLM_ASSERT(is(allocaNode.GetOperation())); @@ -756,7 +756,7 @@ RegionAwareMemoryNodeProvider::AnnotateAlloca(const rvsdg::simple_node & allocaN } void -RegionAwareMemoryNodeProvider::AnnotateMalloc(const rvsdg::simple_node & mallocNode) +RegionAwareMemoryNodeProvider::AnnotateMalloc(const rvsdg::SimpleNode & mallocNode) { JLM_ASSERT(is(mallocNode.GetOperation())); @@ -766,7 +766,7 @@ RegionAwareMemoryNodeProvider::AnnotateMalloc(const rvsdg::simple_node & mallocN } void -RegionAwareMemoryNodeProvider::AnnotateFree(const rvsdg::simple_node & freeNode) +RegionAwareMemoryNodeProvider::AnnotateFree(const rvsdg::SimpleNode & freeNode) { JLM_ASSERT(is(freeNode.GetOperation())); @@ -820,7 +820,7 @@ RegionAwareMemoryNodeProvider::AnnotateCall(const CallNode & callNode) } void -RegionAwareMemoryNodeProvider::AnnotateMemcpy(const rvsdg::simple_node & memcpyNode) +RegionAwareMemoryNodeProvider::AnnotateMemcpy(const rvsdg::SimpleNode & memcpyNode) { JLM_ASSERT(is(memcpyNode.GetOperation())); @@ -896,7 +896,7 @@ RegionAwareMemoryNodeProvider::PropagatePhi(const phi::node & phiNode) PropagateRegion(phiNodeSubregion); util::HashSet memoryNodes; - util::HashSet unknownMemoryNodeReferences; + util::HashSet unknownMemoryNodeReferences; for (auto & lambdaNode : lambdaNodes) { auto & regionSummary = Provisioning_->GetRegionSummary(*lambdaNode->subregion()); @@ -911,7 +911,7 @@ void RegionAwareMemoryNodeProvider::AssignAndPropagateMemoryNodes( const rvsdg::Region & region, const util::HashSet & memoryNodes, - const util::HashSet & unknownMemoryNodeReferences) + const util::HashSet & unknownMemoryNodeReferences) { auto & regionSummary = Provisioning_->GetRegionSummary(region); for (auto structuralNode : regionSummary.GetStructuralNodes().Items()) diff --git a/jlm/llvm/opt/alias-analyses/RegionAwareMemoryNodeProvider.hpp b/jlm/llvm/opt/alias-analyses/RegionAwareMemoryNodeProvider.hpp index 762330f8c..3c00d949d 100644 --- a/jlm/llvm/opt/alias-analyses/RegionAwareMemoryNodeProvider.hpp +++ b/jlm/llvm/opt/alias-analyses/RegionAwareMemoryNodeProvider.hpp @@ -107,7 +107,7 @@ class RegionAwareMemoryNodeProvider final : public MemoryNodeProvider AnnotateRegion(rvsdg::Region & region); void - AnnotateSimpleNode(const rvsdg::simple_node & provider); + AnnotateSimpleNode(const rvsdg::SimpleNode & provider); void AnnotateStructuralNode(const rvsdg::StructuralNode & structuralNode); @@ -119,19 +119,19 @@ class RegionAwareMemoryNodeProvider final : public MemoryNodeProvider AnnotateStore(const StoreNode & storeNode); void - AnnotateAlloca(const rvsdg::simple_node & allocaNode); + AnnotateAlloca(const rvsdg::SimpleNode & allocaNode); void - AnnotateMalloc(const rvsdg::simple_node & mallocNode); + AnnotateMalloc(const rvsdg::SimpleNode & mallocNode); void - AnnotateFree(const rvsdg::simple_node & freeNode); + AnnotateFree(const rvsdg::SimpleNode & freeNode); void AnnotateCall(const CallNode & callNode); void - AnnotateMemcpy(const rvsdg::simple_node & memcpyNode); + AnnotateMemcpy(const rvsdg::SimpleNode & memcpyNode); /** * Propagates the utilized memory locations and simple RVSDG nodes that reference unknown memory @@ -174,7 +174,7 @@ class RegionAwareMemoryNodeProvider final : public MemoryNodeProvider AssignAndPropagateMemoryNodes( const rvsdg::Region & region, const util::HashSet & memoryNodes, - const util::HashSet & unknownMemoryNodeReferences); + const util::HashSet & unknownMemoryNodeReferences); /** * Resolves all references to unknown memory locations. diff --git a/jlm/llvm/opt/alias-analyses/Steensgaard.cpp b/jlm/llvm/opt/alias-analyses/Steensgaard.cpp index 0508e7109..c629a6b6d 100644 --- a/jlm/llvm/opt/alias-analyses/Steensgaard.cpp +++ b/jlm/llvm/opt/alias-analyses/Steensgaard.cpp @@ -30,11 +30,11 @@ HasOrContainsPointerType(const rvsdg::output & output) /** * Determines whether \p node should be handled by the Steensgaard analysis. * - * @param node An rvsdg::simple_node. + * @param node An rvsdg::SimpleNode. * @return True if \p node should be handled, otherwise false. */ static bool -ShouldHandle(const rvsdg::simple_node & node) +ShouldHandle(const rvsdg::SimpleNode & node) { for (size_t n = 0; n < node.ninputs(); n++) { @@ -990,7 +990,7 @@ Steensgaard::~Steensgaard() = default; Steensgaard::Steensgaard() = default; void -Steensgaard::AnalyzeSimpleNode(const jlm::rvsdg::simple_node & node) +Steensgaard::AnalyzeSimpleNode(const jlm::rvsdg::SimpleNode & node) { if (is(&node)) { @@ -1072,7 +1072,7 @@ Steensgaard::AnalyzeSimpleNode(const jlm::rvsdg::simple_node & node) } void -Steensgaard::AnalyzeAlloca(const jlm::rvsdg::simple_node & node) +Steensgaard::AnalyzeAlloca(const jlm::rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -1082,7 +1082,7 @@ Steensgaard::AnalyzeAlloca(const jlm::rvsdg::simple_node & node) } void -Steensgaard::AnalyzeMalloc(const jlm::rvsdg::simple_node & node) +Steensgaard::AnalyzeMalloc(const jlm::rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -1267,7 +1267,7 @@ Steensgaard::AnalyzeIndirectCall(const CallNode & callNode) } void -Steensgaard::AnalyzeGep(const jlm::rvsdg::simple_node & node) +Steensgaard::AnalyzeGep(const jlm::rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -1278,7 +1278,7 @@ Steensgaard::AnalyzeGep(const jlm::rvsdg::simple_node & node) } void -Steensgaard::AnalyzeBitcast(const jlm::rvsdg::simple_node & node) +Steensgaard::AnalyzeBitcast(const jlm::rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -1295,7 +1295,7 @@ Steensgaard::AnalyzeBitcast(const jlm::rvsdg::simple_node & node) } void -Steensgaard::AnalyzeBits2ptr(const jlm::rvsdg::simple_node & node) +Steensgaard::AnalyzeBits2ptr(const jlm::rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -1308,7 +1308,7 @@ Steensgaard::AnalyzeBits2ptr(const jlm::rvsdg::simple_node & node) } void -Steensgaard::AnalyzePtr2Bits(const rvsdg::simple_node & node) +Steensgaard::AnalyzePtr2Bits(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -1316,7 +1316,7 @@ Steensgaard::AnalyzePtr2Bits(const rvsdg::simple_node & node) } void -Steensgaard::AnalyzeExtractValue(const jlm::rvsdg::simple_node & node) +Steensgaard::AnalyzeExtractValue(const jlm::rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -1333,7 +1333,7 @@ Steensgaard::AnalyzeExtractValue(const jlm::rvsdg::simple_node & node) } void -Steensgaard::AnalyzeConstantPointerNull(const jlm::rvsdg::simple_node & node) +Steensgaard::AnalyzeConstantPointerNull(const jlm::rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -1343,7 +1343,7 @@ Steensgaard::AnalyzeConstantPointerNull(const jlm::rvsdg::simple_node & node) } void -Steensgaard::AnalyzeConstantAggregateZero(const jlm::rvsdg::simple_node & node) +Steensgaard::AnalyzeConstantAggregateZero(const jlm::rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); auto & output = *node.output(0); @@ -1357,7 +1357,7 @@ Steensgaard::AnalyzeConstantAggregateZero(const jlm::rvsdg::simple_node & node) } void -Steensgaard::AnalyzeUndef(const jlm::rvsdg::simple_node & node) +Steensgaard::AnalyzeUndef(const jlm::rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); auto & output = *node.output(0); @@ -1371,7 +1371,7 @@ Steensgaard::AnalyzeUndef(const jlm::rvsdg::simple_node & node) } void -Steensgaard::AnalyzeConstantArray(const jlm::rvsdg::simple_node & node) +Steensgaard::AnalyzeConstantArray(const jlm::rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -1392,7 +1392,7 @@ Steensgaard::AnalyzeConstantArray(const jlm::rvsdg::simple_node & node) } void -Steensgaard::AnalyzeConstantStruct(const jlm::rvsdg::simple_node & node) +Steensgaard::AnalyzeConstantStruct(const jlm::rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -1414,7 +1414,7 @@ Steensgaard::AnalyzeConstantStruct(const jlm::rvsdg::simple_node & node) } void -Steensgaard::AnalyzeMemcpy(const jlm::rvsdg::simple_node & node) +Steensgaard::AnalyzeMemcpy(const jlm::rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -1454,7 +1454,7 @@ Steensgaard::AnalyzeMemcpy(const jlm::rvsdg::simple_node & node) } void -Steensgaard::AnalyzeVaList(const rvsdg::simple_node & node) +Steensgaard::AnalyzeVaList(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); @@ -1732,7 +1732,7 @@ Steensgaard::AnalyzeRegion(rvsdg::Region & region) topdown_traverser traverser(®ion); for (auto & node : traverser) { - if (auto simpleNode = dynamic_cast(node)) + if (auto simpleNode = dynamic_cast(node)) { AnalyzeSimpleNode(*simpleNode); } diff --git a/jlm/llvm/opt/alias-analyses/Steensgaard.hpp b/jlm/llvm/opt/alias-analyses/Steensgaard.hpp index e0e4b5952..aa9a83072 100644 --- a/jlm/llvm/opt/alias-analyses/Steensgaard.hpp +++ b/jlm/llvm/opt/alias-analyses/Steensgaard.hpp @@ -16,7 +16,7 @@ class GammaNode; class Graph; class output; class Region; -class simple_node; +class SimpleNode; class StructuralNode; class ThetaNode; } @@ -118,16 +118,16 @@ class Steensgaard final : public AliasAnalysis AnalyzeTheta(const rvsdg::ThetaNode & node); void - AnalyzeSimpleNode(const rvsdg::simple_node & node); + AnalyzeSimpleNode(const rvsdg::SimpleNode & node); void AnalyzeStructuralNode(const rvsdg::StructuralNode & node); void - AnalyzeAlloca(const rvsdg::simple_node & node); + AnalyzeAlloca(const rvsdg::SimpleNode & node); void - AnalyzeMalloc(const rvsdg::simple_node & node); + AnalyzeMalloc(const rvsdg::SimpleNode & node); void AnalyzeLoad(const LoadNode & loadNode); @@ -148,40 +148,40 @@ class Steensgaard final : public AliasAnalysis AnalyzeIndirectCall(const CallNode & callNode); void - AnalyzeGep(const rvsdg::simple_node & node); + AnalyzeGep(const rvsdg::SimpleNode & node); void - AnalyzeBitcast(const rvsdg::simple_node & node); + AnalyzeBitcast(const rvsdg::SimpleNode & node); void - AnalyzeBits2ptr(const rvsdg::simple_node & node); + AnalyzeBits2ptr(const rvsdg::SimpleNode & node); void - AnalyzePtr2Bits(const rvsdg::simple_node & node); + AnalyzePtr2Bits(const rvsdg::SimpleNode & node); void - AnalyzeConstantPointerNull(const rvsdg::simple_node & node); + AnalyzeConstantPointerNull(const rvsdg::SimpleNode & node); void - AnalyzeUndef(const rvsdg::simple_node & node); + AnalyzeUndef(const rvsdg::SimpleNode & node); void - AnalyzeMemcpy(const rvsdg::simple_node & node); + AnalyzeMemcpy(const rvsdg::SimpleNode & node); void - AnalyzeConstantArray(const rvsdg::simple_node & node); + AnalyzeConstantArray(const rvsdg::SimpleNode & node); void - AnalyzeConstantStruct(const rvsdg::simple_node & node); + AnalyzeConstantStruct(const rvsdg::SimpleNode & node); void - AnalyzeConstantAggregateZero(const rvsdg::simple_node & node); + AnalyzeConstantAggregateZero(const rvsdg::SimpleNode & node); void - AnalyzeExtractValue(const rvsdg::simple_node & node); + AnalyzeExtractValue(const rvsdg::SimpleNode & node); void - AnalyzeVaList(const rvsdg::simple_node & node); + AnalyzeVaList(const rvsdg::SimpleNode & node); /** * Marks register \p output as escaping the module. This indicates that the pointer in \p output diff --git a/jlm/llvm/opt/alias-analyses/TopDownMemoryNodeEliminator.cpp b/jlm/llvm/opt/alias-analyses/TopDownMemoryNodeEliminator.cpp index 0c4c118ed..6e3fc2f25 100644 --- a/jlm/llvm/opt/alias-analyses/TopDownMemoryNodeEliminator.cpp +++ b/jlm/llvm/opt/alias-analyses/TopDownMemoryNodeEliminator.cpp @@ -513,7 +513,7 @@ TopDownMemoryNodeEliminator::EliminateTopDownRegion(rvsdg::Region & region) rvsdg::topdown_traverser traverser(®ion); for (auto & node : traverser) { - if (auto simpleNode = dynamic_cast(node)) + if (auto simpleNode = dynamic_cast(node)) { EliminateTopDownSimpleNode(*simpleNode); } @@ -752,7 +752,7 @@ TopDownMemoryNodeEliminator::EliminateTopDownTheta(const rvsdg::ThetaNode & thet } void -TopDownMemoryNodeEliminator::EliminateTopDownSimpleNode(const rvsdg::simple_node & simpleNode) +TopDownMemoryNodeEliminator::EliminateTopDownSimpleNode(const rvsdg::SimpleNode & simpleNode) { if (is(&simpleNode)) { @@ -765,7 +765,7 @@ TopDownMemoryNodeEliminator::EliminateTopDownSimpleNode(const rvsdg::simple_node } void -TopDownMemoryNodeEliminator::EliminateTopDownAlloca(const rvsdg::simple_node & node) +TopDownMemoryNodeEliminator::EliminateTopDownAlloca(const rvsdg::SimpleNode & node) { JLM_ASSERT(is(&node)); diff --git a/jlm/llvm/opt/alias-analyses/TopDownMemoryNodeEliminator.hpp b/jlm/llvm/opt/alias-analyses/TopDownMemoryNodeEliminator.hpp index 65707a0f7..f2b50e776 100644 --- a/jlm/llvm/opt/alias-analyses/TopDownMemoryNodeEliminator.hpp +++ b/jlm/llvm/opt/alias-analyses/TopDownMemoryNodeEliminator.hpp @@ -28,9 +28,9 @@ class node; namespace jlm::rvsdg { class GammaNode; -class node; +class Node; class Region; -class simple_node; +class SimpleNode; class StructuralNode; class ThetaNode; } @@ -155,10 +155,10 @@ class TopDownMemoryNodeEliminator final : public MemoryNodeEliminator EliminateTopDownTheta(const rvsdg::ThetaNode & thetaNode); void - EliminateTopDownSimpleNode(const rvsdg::simple_node & simpleNode); + EliminateTopDownSimpleNode(const rvsdg::SimpleNode & simpleNode); void - EliminateTopDownAlloca(const rvsdg::simple_node & node); + EliminateTopDownAlloca(const rvsdg::SimpleNode & node); void EliminateTopDownCall(const CallNode & callNode); diff --git a/jlm/llvm/opt/cne.cpp b/jlm/llvm/opt/cne.cpp index 159b493bb..94e9016d0 100644 --- a/jlm/llvm/opt/cne.cpp +++ b/jlm/llvm/opt/cne.cpp @@ -388,7 +388,7 @@ mark(const rvsdg::StructuralNode * node, cnectx & ctx) } static void -mark(const jlm::rvsdg::simple_node * node, cnectx & ctx) +mark(const jlm::rvsdg::SimpleNode * node, cnectx & ctx) { if (node->ninputs() == 0) { @@ -431,7 +431,7 @@ mark(rvsdg::Region * region, cnectx & ctx) { for (const auto & node : jlm::rvsdg::topdown_traverser(region)) { - if (auto simple = dynamic_cast(node)) + if (auto simple = dynamic_cast(node)) mark(simple, ctx); else mark(static_cast(node), ctx); @@ -545,7 +545,7 @@ divert(rvsdg::Region * region, cnectx & ctx) { for (const auto & node : jlm::rvsdg::topdown_traverser(region)) { - if (auto simple = dynamic_cast(node)) + if (auto simple = dynamic_cast(node)) divert_outputs(simple, ctx); else divert(static_cast(node), ctx); diff --git a/jlm/llvm/opt/inlining.cpp b/jlm/llvm/opt/inlining.cpp index 217ee8c9d..5f9bcb7cc 100644 --- a/jlm/llvm/opt/inlining.cpp +++ b/jlm/llvm/opt/inlining.cpp @@ -97,7 +97,7 @@ route_to_region(jlm::rvsdg::output * output, rvsdg::Region * region) } static std::vector -route_dependencies(const lambda::node * lambda, const jlm::rvsdg::simple_node * apply) +route_dependencies(const lambda::node * lambda, const jlm::rvsdg::SimpleNode * apply) { JLM_ASSERT(is(apply)); @@ -114,7 +114,7 @@ route_dependencies(const lambda::node * lambda, const jlm::rvsdg::simple_node * } void -inlineCall(jlm::rvsdg::simple_node * call, const lambda::node * lambda) +inlineCall(jlm::rvsdg::SimpleNode * call, const lambda::node * lambda) { JLM_ASSERT(is(call)); diff --git a/jlm/llvm/opt/inlining.hpp b/jlm/llvm/opt/inlining.hpp index 9c15b6b6e..a39b7c944 100644 --- a/jlm/llvm/opt/inlining.hpp +++ b/jlm/llvm/opt/inlining.hpp @@ -30,7 +30,7 @@ jlm::rvsdg::output * find_producer(jlm::rvsdg::input * input); void -inlineCall(jlm::rvsdg::simple_node * call, const lambda::node * lambda); +inlineCall(jlm::rvsdg::SimpleNode * call, const lambda::node * lambda); } diff --git a/jlm/llvm/opt/unroll.cpp b/jlm/llvm/opt/unroll.cpp index c9b7c4825..b81bfffef 100644 --- a/jlm/llvm/opt/unroll.cpp +++ b/jlm/llvm/opt/unroll.cpp @@ -338,9 +338,9 @@ create_unrolled_gamma_predicate(const unrollinfo & ui, size_t factor) auto uf = jlm::rvsdg::create_bitconstant(region, nbits, factor); auto mul = jlm::rvsdg::bitmul_op::create(nbits, step, uf); auto arm = - jlm::rvsdg::simple_node::create_normalized(region, ui.armoperation(), { ui.init(), mul })[0]; + jlm::rvsdg::SimpleNode::create_normalized(region, ui.armoperation(), { ui.init(), mul })[0]; /* FIXME: order of operands */ - auto cmp = jlm::rvsdg::simple_node::create_normalized(region, ui.cmpoperation(), { arm, end })[0]; + auto cmp = jlm::rvsdg::SimpleNode::create_normalized(region, ui.cmpoperation(), { arm, end })[0]; auto pred = jlm::rvsdg::match(1, { { 1, 1 } }, 0, 2, cmp); return pred; @@ -368,9 +368,9 @@ create_unrolled_theta_predicate( auto uf = create_bitconstant(region, nbits, factor); auto mul = bitmul_op::create(nbits, step, uf); - auto arm = simple_node::create_normalized(region, ui.armoperation(), { idv->origin(), mul })[0]; + auto arm = SimpleNode::create_normalized(region, ui.armoperation(), { idv->origin(), mul })[0]; /* FIXME: order of operands */ - auto cmp = simple_node::create_normalized(region, ui.cmpoperation(), { arm, iend->origin() })[0]; + auto cmp = SimpleNode::create_normalized(region, ui.cmpoperation(), { arm, iend->origin() })[0]; auto pred = match(1, { { 1, 1 } }, 0, 2, cmp); return pred; @@ -384,7 +384,7 @@ create_residual_gamma_predicate(const rvsdg::SubstitutionMap & smap, const unrol auto end = ui.end()->input()->origin(); /* FIXME: order of operands */ - auto cmp = jlm::rvsdg::simple_node::create_normalized(region, ui.cmpoperation(), { idv, end })[0]; + auto cmp = jlm::rvsdg::SimpleNode::create_normalized(region, ui.cmpoperation(), { idv, end })[0]; auto pred = jlm::rvsdg::match(1, { { 1, 1 } }, 0, 2, cmp); return pred; diff --git a/jlm/mlir/backend/JlmToMlirConverter.cpp b/jlm/mlir/backend/JlmToMlirConverter.cpp index d08fc86ae..c15163ed5 100644 --- a/jlm/mlir/backend/JlmToMlirConverter.cpp +++ b/jlm/mlir/backend/JlmToMlirConverter.cpp @@ -152,7 +152,7 @@ JlmToMlirConverter::ConvertNode( ::mlir::Block & block, const ::llvm::SmallVector<::mlir::Value> & inputs) { - if (auto simpleNode = dynamic_cast(&node)) + if (auto simpleNode = dynamic_cast(&node)) { return ConvertSimpleNode(*simpleNode, block, inputs); } @@ -302,7 +302,7 @@ JlmToMlirConverter::BitCompareNode( ::mlir::Operation * JlmToMlirConverter::ConvertSimpleNode( - const rvsdg::simple_node & node, + const rvsdg::SimpleNode & node, ::mlir::Block & block, const ::llvm::SmallVector<::mlir::Value> & inputs) { diff --git a/jlm/mlir/backend/JlmToMlirConverter.hpp b/jlm/mlir/backend/JlmToMlirConverter.hpp index 35b0dcf12..efc6c1c0e 100644 --- a/jlm/mlir/backend/JlmToMlirConverter.hpp +++ b/jlm/mlir/backend/JlmToMlirConverter.hpp @@ -134,15 +134,15 @@ class JlmToMlirConverter final BitCompareNode(const rvsdg::SimpleOperation & bitOp, ::llvm::SmallVector<::mlir::Value> inputs); /** - * Converts an RVSDG simple_node to an MLIR RVSDG operation. + * Converts an RVSDG SimpleNode to an MLIR RVSDG operation. * \param node The RVSDG node to be converted * \param block The MLIR RVSDG block to insert the converted node. - * \param inputs The inputs to the simple_node. + * \param inputs The inputs to the SimpleNode. * \return The converted MLIR RVSDG operation. */ ::mlir::Operation * ConvertSimpleNode( - const rvsdg::simple_node & node, + const rvsdg::SimpleNode & node, ::mlir::Block & block, const ::llvm::SmallVector<::mlir::Value> & inputs); diff --git a/jlm/rvsdg/binary.cpp b/jlm/rvsdg/binary.cpp index 2aa8d6a80..67407691e 100644 --- a/jlm/rvsdg/binary.cpp +++ b/jlm/rvsdg/binary.cpp @@ -143,7 +143,7 @@ binary_normal_form::normalize_node(Node * node, const binary_op & op) const JLM_ASSERT(new_args.size() >= 2); const auto & new_op = tmp_op ? *tmp_op : static_cast(op); - divert_users(node, simple_node::create_normalized(node->region(), new_op, new_args)); + divert_users(node, SimpleNode::create_normalized(node->region(), new_op, new_args)); remove(node); return false; } @@ -364,7 +364,7 @@ reduce_parallel(const binary_op & op, const std::vector & auto op2 = worklist.front(); worklist.pop_front(); - auto output = simple_node::create_normalized(region, op, { op1, op2 })[0]; + auto output = SimpleNode::create_normalized(region, op, { op1, op2 })[0]; worklist.push_back(output); } @@ -387,7 +387,7 @@ reduce_linear(const binary_op & op, const std::vector & op auto op2 = worklist.front(); worklist.pop_front(); - auto output = simple_node::create_normalized(region, op, { op1, op2 })[0]; + auto output = SimpleNode::create_normalized(region, op, { op1, op2 })[0]; worklist.push_front(output); } diff --git a/jlm/rvsdg/bitstring/arithmetic.hpp b/jlm/rvsdg/bitstring/arithmetic.hpp index d91340df3..fbdb75ae6 100644 --- a/jlm/rvsdg/bitstring/arithmetic.hpp +++ b/jlm/rvsdg/bitstring/arithmetic.hpp @@ -40,7 +40,7 @@ class MakeBitUnaryOperation final : public bitunary_op static output * create(size_t nbits, output * op) { - return simple_node::create_normalized(op->region(), MakeBitUnaryOperation(nbits), { op })[0]; + return SimpleNode::create_normalized(op->region(), MakeBitUnaryOperation(nbits), { op })[0]; } }; @@ -75,7 +75,7 @@ class MakeBitBinaryOperation final : public bitbinary_op static output * create(size_t nbits, output * op1, output * op2) { - return simple_node::create_normalized( + return SimpleNode::create_normalized( op1->region(), MakeBitBinaryOperation(nbits), { op1, op2 })[0]; diff --git a/jlm/rvsdg/bitstring/comparison.hpp b/jlm/rvsdg/bitstring/comparison.hpp index bd1799166..dfad6f280 100644 --- a/jlm/rvsdg/bitstring/comparison.hpp +++ b/jlm/rvsdg/bitstring/comparison.hpp @@ -44,7 +44,7 @@ class MakeBitComparisonOperation final : public bitcompare_op static output * create(size_t nbits, output * op1, output * op2) { - return simple_node::create_normalized( + return SimpleNode::create_normalized( op1->region(), MakeBitComparisonOperation(nbits), { op1, op2 })[0]; diff --git a/jlm/rvsdg/bitstring/concat.cpp b/jlm/rvsdg/bitstring/concat.cpp index f32885497..e188db419 100644 --- a/jlm/rvsdg/bitstring/concat.cpp +++ b/jlm/rvsdg/bitstring/concat.cpp @@ -21,7 +21,7 @@ bitconcat(const std::vector & operands) auto region = operands[0]->region(); jlm::rvsdg::bitconcat_op op(std::move(types)); - return jlm::rvsdg::simple_node::create_normalized( + return jlm::rvsdg::SimpleNode::create_normalized( region, op, { operands.begin(), operands.end() })[0]; @@ -133,7 +133,7 @@ class concat_normal_form final : public simple_normal_form if (args != new_args) { bitconcat_op op(types_from_arguments(new_args)); - divert_users(node, simple_node::create_normalized(node->region(), op, new_args)); + divert_users(node, SimpleNode::create_normalized(node->region(), op, new_args)); remove(node); return false; } diff --git a/jlm/rvsdg/bitstring/constant.hpp b/jlm/rvsdg/bitstring/constant.hpp index 849986be7..fd3655f03 100644 --- a/jlm/rvsdg/bitstring/constant.hpp +++ b/jlm/rvsdg/bitstring/constant.hpp @@ -59,7 +59,7 @@ extern template class domain_const_op(argument->Type()); jlm::rvsdg::bitslice_op op(type, low, high); - return jlm::rvsdg::simple_node::create_normalized(argument->region(), op, { argument })[0]; + return jlm::rvsdg::SimpleNode::create_normalized(argument->region(), op, { argument })[0]; } } diff --git a/jlm/rvsdg/control.cpp b/jlm/rvsdg/control.cpp index 6810f1a31..d9e312ca1 100644 --- a/jlm/rvsdg/control.cpp +++ b/jlm/rvsdg/control.cpp @@ -155,14 +155,14 @@ match( jlm::rvsdg::output * operand) { match_op op(nbits, mapping, default_alternative, nalternatives); - return simple_node::create_normalized(operand->region(), op, { operand })[0]; + return SimpleNode::create_normalized(operand->region(), op, { operand })[0]; } jlm::rvsdg::output * control_constant(rvsdg::Region * region, size_t nalternatives, size_t alternative) { jlm::rvsdg::ctlconstant_op op({ alternative, nalternatives }); - return jlm::rvsdg::simple_node::create_normalized(region, op, {})[0]; + return jlm::rvsdg::SimpleNode::create_normalized(region, op, {})[0]; } } diff --git a/jlm/rvsdg/control.hpp b/jlm/rvsdg/control.hpp index b43f8e429..0ba8e478c 100644 --- a/jlm/rvsdg/control.hpp +++ b/jlm/rvsdg/control.hpp @@ -216,7 +216,7 @@ class match_op final : public jlm::rvsdg::unary_op auto bitType = CheckAndExtractBitType(predicate.type()); match_op operation(bitType.nbits(), mapping, defaultAlternative, numAlternatives); - return rvsdg::simple_node::create_normalized(predicate.region(), operation, { &predicate })[0]; + return rvsdg::SimpleNode::create_normalized(predicate.region(), operation, { &predicate })[0]; } private: diff --git a/jlm/rvsdg/nullary.hpp b/jlm/rvsdg/nullary.hpp index 7e48bdf2f..6ae61c364 100644 --- a/jlm/rvsdg/nullary.hpp +++ b/jlm/rvsdg/nullary.hpp @@ -98,7 +98,7 @@ class domain_const_op final : public nullary_op create(rvsdg::Region * region, const value_repr & vr) { domain_const_op op(vr); - return simple_node::create_normalized(region, op, {})[0]; + return SimpleNode::create_normalized(region, op, {})[0]; } private: diff --git a/jlm/rvsdg/region.hpp b/jlm/rvsdg/region.hpp index 843408d7c..c5167d7a1 100644 --- a/jlm/rvsdg/region.hpp +++ b/jlm/rvsdg/region.hpp @@ -21,7 +21,7 @@ namespace jlm::rvsdg { class Node; -class simple_node; +class SimpleNode; class SimpleOperation; class StructuralInput; class StructuralNode; diff --git a/jlm/rvsdg/simple-node.cpp b/jlm/rvsdg/simple-node.cpp index 5d4d5180c..cf85381b6 100644 --- a/jlm/rvsdg/simple-node.cpp +++ b/jlm/rvsdg/simple-node.cpp @@ -19,7 +19,7 @@ simple_input::~simple_input() noexcept } simple_input::simple_input( - jlm::rvsdg::simple_node * node, + jlm::rvsdg::SimpleNode * node, jlm::rvsdg::output * origin, std::shared_ptr type) : node_input(origin, node, std::move(type)) @@ -27,9 +27,7 @@ simple_input::simple_input( /* outputs */ -simple_output::simple_output( - jlm::rvsdg::simple_node * node, - std::shared_ptr type) +simple_output::simple_output(jlm::rvsdg::SimpleNode * node, std::shared_ptr type) : node_output(node, std::move(type)) {} @@ -38,47 +36,45 @@ simple_output::~simple_output() noexcept on_output_destroy(this); } -/* simple nodes */ - -simple_node::~simple_node() +SimpleNode::~SimpleNode() { on_node_destroy(this); } -simple_node::simple_node( +SimpleNode::SimpleNode( rvsdg::Region * region, const SimpleOperation & op, const std::vector & operands) : Node(op.copy(), region) { - if (simple_node::GetOperation().narguments() != operands.size()) + if (SimpleNode::GetOperation().narguments() != operands.size()) throw jlm::util::error(jlm::util::strfmt( "Argument error - expected ", - simple_node::GetOperation().narguments(), - ", received ", - operands.size(), + SimpleNode::GetOperation().narguments(), + ", received ", + operands.size(), " arguments.")); - for (size_t n = 0; n < simple_node::GetOperation().narguments(); n++) + for (size_t n = 0; n < SimpleNode::GetOperation().narguments(); n++) { add_input( - std::make_unique(this, operands[n], simple_node::GetOperation().argument(n))); + std::make_unique(this, operands[n], SimpleNode::GetOperation().argument(n))); } - for (size_t n = 0; n < simple_node::GetOperation().nresults(); n++) - add_output(std::make_unique(this, simple_node::GetOperation().result(n))); + for (size_t n = 0; n < SimpleNode::GetOperation().nresults(); n++) + add_output(std::make_unique(this, SimpleNode::GetOperation().result(n))); on_node_create(this); } const SimpleOperation & -simple_node::GetOperation() const noexcept +SimpleNode::GetOperation() const noexcept { return *util::AssertedCast(&Node::GetOperation()); } Node * -simple_node::copy(rvsdg::Region * region, const std::vector & operands) const +SimpleNode::copy(rvsdg::Region * region, const std::vector & operands) const { auto node = create(region, GetOperation(), operands); graph()->mark_denormalized(); @@ -86,7 +82,7 @@ simple_node::copy(rvsdg::Region * region, const std::vector operands; for (size_t n = 0; n < ninputs(); n++) diff --git a/jlm/rvsdg/simple-node.hpp b/jlm/rvsdg/simple-node.hpp index 1a7a8c02c..eb20c0c6d 100644 --- a/jlm/rvsdg/simple-node.hpp +++ b/jlm/rvsdg/simple-node.hpp @@ -18,15 +18,13 @@ class SimpleOperation; class simple_input; class simple_output; -/* simple nodes */ - -class simple_node : public Node +class SimpleNode : public Node { public: - virtual ~simple_node(); + ~SimpleNode() override; protected: - simple_node( + SimpleNode( rvsdg::Region * region, const SimpleOperation & op, const std::vector & operands); @@ -47,13 +45,13 @@ class simple_node : public Node Node * copy(rvsdg::Region * region, SubstitutionMap & smap) const override; - static inline jlm::rvsdg::simple_node * + static inline jlm::rvsdg::SimpleNode * create( rvsdg::Region * region, const SimpleOperation & op, const std::vector & operands) { - return new simple_node(region, op, operands); + return new SimpleNode(region, op, operands); } static inline std::vector @@ -77,15 +75,15 @@ class simple_input final : public node_input virtual ~simple_input() noexcept; simple_input( - simple_node * node, + SimpleNode * node, jlm::rvsdg::output * origin, std::shared_ptr type); public: - simple_node * + SimpleNode * node() const noexcept { - return static_cast(node_input::node()); + return static_cast(node_input::node()); } }; @@ -98,26 +96,26 @@ class simple_output final : public node_output public: virtual ~simple_output() noexcept; - simple_output(jlm::rvsdg::simple_node * node, std::shared_ptr type); + simple_output(jlm::rvsdg::SimpleNode * node, std::shared_ptr type); public: - simple_node * + SimpleNode * node() const noexcept { - return static_cast(node_output::node()); + return static_cast(node_output::node()); } }; /* simple node method definitions */ inline jlm::rvsdg::simple_input * -simple_node::input(size_t index) const noexcept +SimpleNode::input(size_t index) const noexcept { return static_cast(Node::input(index)); } inline jlm::rvsdg::simple_output * -simple_node::output(size_t index) const noexcept +SimpleNode::output(size_t index) const noexcept { return static_cast(Node::output(index)); } diff --git a/jlm/rvsdg/simple-normal-form.cpp b/jlm/rvsdg/simple-normal-form.cpp index b305933ae..07ca14cdb 100644 --- a/jlm/rvsdg/simple-normal-form.cpp +++ b/jlm/rvsdg/simple-normal-form.cpp @@ -89,7 +89,7 @@ simple_normal_form::normalized_create( if (get_mutable() && get_cse()) node = node_cse(region, op, arguments); if (!node) - node = simple_node::create(region, op, arguments); + node = SimpleNode::create(region, op, arguments); return outputs(node); } diff --git a/jlm/rvsdg/statemux.hpp b/jlm/rvsdg/statemux.hpp index 4b688f0c8..77ceceb41 100644 --- a/jlm/rvsdg/statemux.hpp +++ b/jlm/rvsdg/statemux.hpp @@ -106,7 +106,7 @@ create_state_mux( auto region = operands.front()->region(); jlm::rvsdg::mux_op op(std::move(st), operands.size(), nresults); - return simple_node::create_normalized(region, op, operands); + return SimpleNode::create_normalized(region, op, operands); } static inline jlm::rvsdg::output * diff --git a/jlm/rvsdg/view.cpp b/jlm/rvsdg/view.cpp index 6dc3bf388..94bd1d0a1 100644 --- a/jlm/rvsdg/view.cpp +++ b/jlm/rvsdg/view.cpp @@ -275,7 +275,7 @@ static std::string convert_region(const jlm::rvsdg::Region * region); static inline std::string -convert_simple_node(const jlm::rvsdg::simple_node * node) +convert_simple_node(const jlm::rvsdg::SimpleNode * node) { std::string s; @@ -324,7 +324,7 @@ convert_structural_node(const rvsdg::StructuralNode * node) static inline std::string convert_node(const Node * node) { - if (auto n = dynamic_cast(node)) + if (auto n = dynamic_cast(node)) return convert_simple_node(n); if (auto n = dynamic_cast(node)) diff --git a/tests/TestRvsdgs.cpp b/tests/TestRvsdgs.cpp index 0b4bc4ded..e04e547fa 100644 --- a/tests/TestRvsdgs.cpp +++ b/tests/TestRvsdgs.cpp @@ -1042,9 +1042,8 @@ IndirectCallTest2::SetupRvsdg() lambdaOutput, &callX, &callY, - jlm::util::AssertedCast(jlm::rvsdg::output::GetNode(*pxAlloca[0])), - jlm::util::AssertedCast( - jlm::rvsdg::output::GetNode(*pyAlloca[0]))); + jlm::util::AssertedCast(jlm::rvsdg::output::GetNode(*pxAlloca[0])), + jlm::util::AssertedCast(jlm::rvsdg::output::GetNode(*pyAlloca[0]))); }; auto SetupTest2Function = [&](rvsdg::output & functionX) @@ -1077,8 +1076,7 @@ IndirectCallTest2::SetupRvsdg() return std::make_tuple( lambdaOutput, &callX, - jlm::util::AssertedCast( - jlm::rvsdg::output::GetNode(*pzAlloca[0]))); + jlm::util::AssertedCast(jlm::rvsdg::output::GetNode(*pzAlloca[0]))); }; auto deltaG1 = SetupG1(); @@ -2284,8 +2282,7 @@ PhiTest2::SetupRvsdg() lambdaOutput, &callB, &callD, - jlm::util::AssertedCast( - jlm::rvsdg::output::GetNode(*paAlloca[0]))); + jlm::util::AssertedCast(jlm::rvsdg::output::GetNode(*paAlloca[0]))); }; auto SetupB = [&](jlm::rvsdg::Region & region, @@ -2329,8 +2326,7 @@ PhiTest2::SetupRvsdg() lambdaOutput, &callI, &callC, - jlm::util::AssertedCast( - jlm::rvsdg::output::GetNode(*pbAlloca[0]))); + jlm::util::AssertedCast(jlm::rvsdg::output::GetNode(*pbAlloca[0]))); }; auto SetupC = [&](jlm::rvsdg::Region & region, phi::rvargument & functionA) @@ -2368,8 +2364,7 @@ PhiTest2::SetupRvsdg() return std::make_tuple( lambdaOutput, &callA, - jlm::util::AssertedCast( - jlm::rvsdg::output::GetNode(*pcAlloca[0]))); + jlm::util::AssertedCast(jlm::rvsdg::output::GetNode(*pcAlloca[0]))); }; auto SetupD = [&](jlm::rvsdg::Region & region, phi::rvargument & functionA) @@ -2398,8 +2393,7 @@ PhiTest2::SetupRvsdg() return std::make_tuple( lambdaOutput, &callA, - jlm::util::AssertedCast( - jlm::rvsdg::output::GetNode(*pdAlloca[0]))); + jlm::util::AssertedCast(jlm::rvsdg::output::GetNode(*pdAlloca[0]))); }; auto SetupPhi = [&](rvsdg::output & lambdaEight, rvsdg::output & lambdaI) @@ -2480,7 +2474,7 @@ PhiTest2::SetupRvsdg() return std::make_tuple( lambdaOutput, &callA, - jlm::util::AssertedCast( + jlm::util::AssertedCast( jlm::rvsdg::output::GetNode(*pTestAlloca[0]))); }; diff --git a/tests/TestRvsdgs.hpp b/tests/TestRvsdgs.hpp index dd37d7ee6..5b2ade48f 100644 --- a/tests/TestRvsdgs.hpp +++ b/tests/TestRvsdgs.hpp @@ -760,19 +760,19 @@ class IndirectCallTest2 final : public RvsdgTest return *CallY_; } - [[nodiscard]] jlm::rvsdg::simple_node & + [[nodiscard]] jlm::rvsdg::SimpleNode & GetAllocaPx() const noexcept { return *AllocaPx_; } - [[nodiscard]] jlm::rvsdg::simple_node & + [[nodiscard]] jlm::rvsdg::SimpleNode & GetAllocaPy() const noexcept { return *AllocaPy_; } - [[nodiscard]] jlm::rvsdg::simple_node & + [[nodiscard]] jlm::rvsdg::SimpleNode & GetAllocaPz() const noexcept { return *AllocaPz_; @@ -800,9 +800,9 @@ class IndirectCallTest2 final : public RvsdgTest jlm::llvm::CallNode * Test2CallX_; jlm::llvm::CallNode * CallY_; - jlm::rvsdg::simple_node * AllocaPx_; - jlm::rvsdg::simple_node * AllocaPy_; - jlm::rvsdg::simple_node * AllocaPz_; + jlm::rvsdg::SimpleNode * AllocaPx_; + jlm::rvsdg::SimpleNode * AllocaPy_; + jlm::rvsdg::SimpleNode * AllocaPz_; }; /** @@ -1566,31 +1566,31 @@ class PhiTest2 final : public RvsdgTest return *IndirectCall_; } - [[nodiscard]] jlm::rvsdg::simple_node & + [[nodiscard]] jlm::rvsdg::SimpleNode & GetPTestAlloca() const noexcept { return *PTestAlloca_; } - [[nodiscard]] jlm::rvsdg::simple_node & + [[nodiscard]] jlm::rvsdg::SimpleNode & GetPaAlloca() const noexcept { return *PaAlloca_; } - [[nodiscard]] jlm::rvsdg::simple_node & + [[nodiscard]] jlm::rvsdg::SimpleNode & GetPbAlloca() const noexcept { return *PbAlloca_; } - [[nodiscard]] jlm::rvsdg::simple_node & + [[nodiscard]] jlm::rvsdg::SimpleNode & GetPcAlloca() const noexcept { return *PcAlloca_; } - [[nodiscard]] jlm::rvsdg::simple_node & + [[nodiscard]] jlm::rvsdg::SimpleNode & GetPdAlloca() const noexcept { return *PdAlloca_; @@ -1617,11 +1617,11 @@ class PhiTest2 final : public RvsdgTest jlm::llvm::CallNode * CallI_; jlm::llvm::CallNode * IndirectCall_; - jlm::rvsdg::simple_node * PTestAlloca_; - jlm::rvsdg::simple_node * PaAlloca_; - jlm::rvsdg::simple_node * PbAlloca_; - jlm::rvsdg::simple_node * PcAlloca_; - jlm::rvsdg::simple_node * PdAlloca_; + jlm::rvsdg::SimpleNode * PTestAlloca_; + jlm::rvsdg::SimpleNode * PaAlloca_; + jlm::rvsdg::SimpleNode * PbAlloca_; + jlm::rvsdg::SimpleNode * PcAlloca_; + jlm::rvsdg::SimpleNode * PdAlloca_; }; /** diff --git a/tests/jlm/hls/backend/rvsdg2rhls/MemoryConverterTests.cpp b/tests/jlm/hls/backend/rvsdg2rhls/MemoryConverterTests.cpp index 415bc23fe..37a4b3ad9 100644 --- a/tests/jlm/hls/backend/rvsdg2rhls/MemoryConverterTests.cpp +++ b/tests/jlm/hls/backend/rvsdg2rhls/MemoryConverterTests.cpp @@ -281,12 +281,12 @@ TestThetaLoad() jlm::rvsdg::bitsgt_op sgt(32); jlm::rvsdg::bitadd_op add(32); jlm::rvsdg::bitsub_op sub(32); - auto arm = jlm::rvsdg::simple_node::create_normalized( + auto arm = jlm::rvsdg::SimpleNode::create_normalized( thetaRegion, add, { idv->argument(), lvs->argument() })[0]; auto cmp = - jlm::rvsdg::simple_node::create_normalized(thetaRegion, ult, { arm, lve->argument() })[0]; + jlm::rvsdg::SimpleNode::create_normalized(thetaRegion, ult, { arm, lve->argument() })[0]; auto match = jlm::rvsdg::match(1, { { 1, 1 } }, 0, 2, cmp); idv->result()->divert_to(arm); theta->set_predicate(match); diff --git a/tests/jlm/hls/backend/rvsdg2rhls/TestFork.cpp b/tests/jlm/hls/backend/rvsdg2rhls/TestFork.cpp index d739580fb..285647ca8 100644 --- a/tests/jlm/hls/backend/rvsdg2rhls/TestFork.cpp +++ b/tests/jlm/hls/backend/rvsdg2rhls/TestFork.cpp @@ -39,8 +39,8 @@ TestFork() rvsdg::output * lveBuffer; loop->add_loopvar(lambda->GetFunctionArguments()[2], &lveBuffer); - auto arm = rvsdg::simple_node::create_normalized(subregion, add, { idvBuffer, lvsBuffer })[0]; - auto cmp = rvsdg::simple_node::create_normalized(subregion, ult, { arm, lveBuffer })[0]; + auto arm = rvsdg::SimpleNode::create_normalized(subregion, add, { idvBuffer, lvsBuffer })[0]; + auto cmp = rvsdg::SimpleNode::create_normalized(subregion, ult, { arm, lveBuffer })[0]; auto match = rvsdg::match(1, { { 1, 1 } }, 0, 2, cmp); loop->set_predicate(match); @@ -105,8 +105,8 @@ TestConstantFork() loop->add_loopvar(lambda->GetFunctionArguments()[0], &idvBuffer); auto bitConstant1 = rvsdg::create_bitconstant(subregion, 32, 1); - auto arm = rvsdg::simple_node::create_normalized(subregion, add, { idvBuffer, bitConstant1 })[0]; - auto cmp = rvsdg::simple_node::create_normalized(subregion, ult, { arm, bitConstant1 })[0]; + auto arm = rvsdg::SimpleNode::create_normalized(subregion, add, { idvBuffer, bitConstant1 })[0]; + auto cmp = rvsdg::SimpleNode::create_normalized(subregion, ult, { arm, bitConstant1 })[0]; auto match = rvsdg::match(1, { { 1, 1 } }, 0, 2, cmp); loop->set_predicate(match); diff --git a/tests/jlm/hls/backend/rvsdg2rhls/TestTheta.cpp b/tests/jlm/hls/backend/rvsdg2rhls/TestTheta.cpp index 32699ff96..18575ede2 100644 --- a/tests/jlm/hls/backend/rvsdg2rhls/TestTheta.cpp +++ b/tests/jlm/hls/backend/rvsdg2rhls/TestTheta.cpp @@ -37,12 +37,11 @@ TestUnknownBoundaries() auto lvs = theta->add_loopvar(lambda->GetFunctionArguments()[1]); auto lve = theta->add_loopvar(lambda->GetFunctionArguments()[2]); - auto arm = jlm::rvsdg::simple_node::create_normalized( + auto arm = jlm::rvsdg::SimpleNode::create_normalized( subregion, add, { idv->argument(), lvs->argument() })[0]; - auto cmp = - jlm::rvsdg::simple_node::create_normalized(subregion, ult, { arm, lve->argument() })[0]; + auto cmp = jlm::rvsdg::SimpleNode::create_normalized(subregion, ult, { arm, lve->argument() })[0]; auto match = jlm::rvsdg::match(1, { { 1, 1 } }, 0, 2, cmp); idv->result()->divert_to(arm); diff --git a/tests/jlm/llvm/opt/test-unroll.cpp b/tests/jlm/llvm/opt/test-unroll.cpp index 2bbb9b6dc..034b06e80 100644 --- a/tests/jlm/llvm/opt/test-unroll.cpp +++ b/tests/jlm/llvm/opt/test-unroll.cpp @@ -51,9 +51,8 @@ create_theta( auto lvs = theta->add_loopvar(step); auto lve = theta->add_loopvar(end); - auto arm = - simple_node::create_normalized(subregion, aop, { idv->argument(), lvs->argument() })[0]; - auto cmp = simple_node::create_normalized(subregion, cop, { arm, lve->argument() })[0]; + auto arm = SimpleNode::create_normalized(subregion, aop, { idv->argument(), lvs->argument() })[0]; + auto cmp = SimpleNode::create_normalized(subregion, cop, { arm, lve->argument() })[0]; auto match = jlm::rvsdg::match(1, { { 1, 1 } }, 0, 2, cmp); idv->result()->divert_to(arm); diff --git a/tests/jlm/mlir/backend/TestJlmToMlirConverter.cpp b/tests/jlm/mlir/backend/TestJlmToMlirConverter.cpp index 105bd8497..bcc30cb9f 100644 --- a/tests/jlm/mlir/backend/TestJlmToMlirConverter.cpp +++ b/tests/jlm/mlir/backend/TestJlmToMlirConverter.cpp @@ -264,9 +264,8 @@ TestComZeroExt() // zero extension of constant1 auto zeroExtOp = jlm::llvm::zext_op(8, 16); - auto zeroExt = jlm::rvsdg::simple_node::create_normalized( - lambda->subregion(), - zeroExtOp, + auto zeroExt = + jlm::rvsdg::SimpleNode::create_normalized(lambda->subregion(), zeroExtOp, { constant1 })[0]; auto mul = jlm::rvsdg::bitmul_op::create(16, zeroExt, zeroExt); diff --git a/tests/jlm/rvsdg/test-binary.cpp b/tests/jlm/rvsdg/test-binary.cpp index 235f420c9..eee0cd3ff 100644 --- a/tests/jlm/rvsdg/test-binary.cpp +++ b/tests/jlm/rvsdg/test-binary.cpp @@ -25,9 +25,9 @@ test_flattened_binary_reduction() auto i2 = &jlm::tests::GraphImport::Create(graph, vt, ""); auto i3 = &jlm::tests::GraphImport::Create(graph, vt, ""); - auto o1 = simple_node::create_normalized(graph.root(), op, { i0, i1 })[0]; - auto o2 = simple_node::create_normalized(graph.root(), op, { o1, i2 })[0]; - auto o3 = simple_node::create_normalized(graph.root(), op, { o2, i3 })[0]; + auto o1 = SimpleNode::create_normalized(graph.root(), op, { i0, i1 })[0]; + auto o2 = SimpleNode::create_normalized(graph.root(), op, { o1, i2 })[0]; + auto o3 = SimpleNode::create_normalized(graph.root(), op, { o2, i3 })[0]; auto & ex = jlm::tests::GraphExport::Create(*o3, ""); graph.prune(); @@ -59,9 +59,9 @@ test_flattened_binary_reduction() auto i2 = &jlm::tests::GraphImport::Create(graph, vt, ""); auto i3 = &jlm::tests::GraphImport::Create(graph, vt, ""); - auto o1 = simple_node::create_normalized(graph.root(), op, { i0, i1 })[0]; - auto o2 = simple_node::create_normalized(graph.root(), op, { o1, i2 })[0]; - auto o3 = simple_node::create_normalized(graph.root(), op, { o2, i3 })[0]; + auto o1 = SimpleNode::create_normalized(graph.root(), op, { i0, i1 })[0]; + auto o2 = SimpleNode::create_normalized(graph.root(), op, { o1, i2 })[0]; + auto o3 = SimpleNode::create_normalized(graph.root(), op, { o2, i3 })[0]; auto & ex = jlm::tests::GraphExport::Create(*o3, ""); graph.prune(); diff --git a/tests/test-operation.hpp b/tests/test-operation.hpp index f694ae623..eee6315ab 100644 --- a/tests/test-operation.hpp +++ b/tests/test-operation.hpp @@ -101,7 +101,7 @@ class unary_op final : public rvsdg::unary_op rvsdg::output * operand, std::shared_ptr dsttype) { - return rvsdg::simple_node::create( + return rvsdg::SimpleNode::create( region, unary_op(std::move(srctype), std::move(dsttype)), { operand }); @@ -114,7 +114,7 @@ class unary_op final : public rvsdg::unary_op std::shared_ptr dsttype) { unary_op op(std::move(srctype), std::move(dsttype)); - return rvsdg::simple_node::create_normalized(operand->region(), op, { operand })[0]; + return rvsdg::SimpleNode::create_normalized(operand->region(), op, { operand })[0]; } }; @@ -173,7 +173,7 @@ class binary_op final : public rvsdg::binary_op rvsdg::output * op2) { binary_op op(srctype, std::move(dsttype), rvsdg::binary_op::flags::none); - return rvsdg::simple_node::create(op1->region(), op, { op1, op2 }); + return rvsdg::SimpleNode::create(op1->region(), op, { op1, op2 }); } static inline rvsdg::output * @@ -184,7 +184,7 @@ class binary_op final : public rvsdg::binary_op rvsdg::output * op2) { binary_op op(srctype, std::move(dsttype), rvsdg::binary_op::flags::none); - return rvsdg::simple_node::create_normalized(op1->region(), op, { op1, op2 })[0]; + return rvsdg::SimpleNode::create_normalized(op1->region(), op, { op1, op2 })[0]; } private: @@ -382,7 +382,7 @@ class test_op final : public rvsdg::SimpleOperation [[nodiscard]] std::unique_ptr copy() const override; - static rvsdg::simple_node * + static rvsdg::SimpleNode * create( rvsdg::Region * region, const std::vector & operands, @@ -393,10 +393,10 @@ class test_op final : public rvsdg::SimpleOperation operand_types.push_back(operand->Type()); test_op op(std::move(operand_types), std::move(result_types)); - return rvsdg::simple_node::create(region, op, { operands }); + return rvsdg::SimpleNode::create(region, op, { operands }); } - static rvsdg::simple_node * + static rvsdg::SimpleNode * Create( rvsdg::Region * region, std::vector> operandTypes, @@ -404,18 +404,18 @@ class test_op final : public rvsdg::SimpleOperation std::vector> resultTypes) { test_op op(std::move(operandTypes), std::move(resultTypes)); - return rvsdg::simple_node::create(region, op, { operands }); + return rvsdg::SimpleNode::create(region, op, { operands }); } }; -class SimpleNode final : public rvsdg::simple_node +class SimpleNode final : public rvsdg::SimpleNode { private: SimpleNode( rvsdg::Region & region, const test_op & operation, const std::vector & operands) - : simple_node(®ion, operation, operands) + : rvsdg::SimpleNode(®ion, operation, operands) {} public: @@ -475,7 +475,7 @@ create_testop( operand_types.push_back(operand->Type()); test_op op(std::move(operand_types), std::move(result_types)); - return rvsdg::simple_node::create_normalized(region, op, { operands }); + return rvsdg::SimpleNode::create_normalized(region, op, { operands }); } class TestGraphArgument final : public jlm::rvsdg::RegionArgument