• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

daisytuner / sdfglib / 15075964231

16 May 2025 07:28PM UTC coverage: 63.623% (+0.1%) from 63.496%
15075964231

push

github

web-flow
Merge pull request #16 from daisytuner/segfaults

Enable Wall, Werror and Wpedantic

98 of 120 new or added lines in 39 files covered. (81.67%)

4 existing lines in 4 files now uncovered.

8633 of 13569 relevant lines covered (63.62%)

483.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

40.0
/src/passes/dataflow/dead_reference_elimination.cpp
1
#include "sdfg/passes/dataflow/dead_reference_elimination.h"
2

3
namespace sdfg {
4
namespace passes {
5

6
DeadReferenceElimination::DeadReferenceElimination()
3✔
7
    : Pass(){
3✔
8

9
      };
3✔
10

11
std::string DeadReferenceElimination::name() { return "DeadReferenceElimination"; };
×
12

13
bool DeadReferenceElimination::run_pass(builder::StructuredSDFGBuilder& builder,
3✔
14
                                        analysis::AnalysisManager& analysis_manager) {
15
    bool applied = false;
3✔
16

17
    auto& sdfg = builder.subject();
3✔
18
    auto& users = analysis_manager.get<analysis::Users>();
3✔
19

20
    std::list<std::string> containers_copy;
3✔
21
    for (auto& name : sdfg.containers()) {
24✔
22
        if (!sdfg.is_transient(name)) {
21✔
23
            continue;
9✔
24
        }
25
        if (!dynamic_cast<const types::Pointer*>(&sdfg.type(name))) {
12✔
26
            continue;
12✔
27
        }
28
        containers_copy.push_back(name);
×
29
    }
30

31
    for (auto& name : containers_copy) {
3✔
32
        auto moves = users.moves(name);
×
33
        auto uses = users.uses(name);
×
34
        if (uses.size() != moves.size()) {
×
35
            continue;
×
36
        }
37

38
        bool assigned = false;
×
39
        for (auto& move : moves) {
×
40
            auto access_node = dynamic_cast<data_flow::AccessNode*>(move->element());
×
41
            auto& graph = dynamic_cast<data_flow::DataFlowGraph&>(access_node->get_parent());
×
42
            auto& edge = *graph.in_edges(*access_node).begin();
×
43
            if (edge.dst_conn() == "void") {
×
44
                assigned = true;
×
45
                break;
×
46
            }
47
        }
48
        if (assigned) {
×
49
            continue;
×
50
        }
51

52
        for (auto& move : moves) {
×
53
            auto access_node = dynamic_cast<data_flow::AccessNode*>(move->element());
×
54
            auto& graph = dynamic_cast<data_flow::DataFlowGraph&>(access_node->get_parent());
×
NEW
55
            auto& block = dynamic_cast<structured_control_flow::Block&>(*graph.get_parent());
×
56
            builder.clear_node(block, *access_node);
×
57
            applied = true;
×
58
        }
59

60
        builder.remove_container(name);
×
61
    }
×
62

63
    return applied;
3✔
64
};
3✔
65

66
}  // namespace passes
67
}  // namespace sdfg
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc