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

daisytuner / sdfglib / 18779783495

24 Oct 2025 12:29PM UTC coverage: 61.711% (-0.02%) from 61.726%
18779783495

push

github

web-flow
Merge pull request #301 from daisytuner/dead-reference-allocations

consider managed allocations in dead reference elimination

0 of 5 new or added lines in 1 file covered. (0.0%)

1 existing line in 1 file now uncovered.

9812 of 15900 relevant lines covered (61.71%)

103.34 hits per line

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

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

3
#include "sdfg/analysis/users.h"
4

5
namespace sdfg {
6
namespace passes {
7

8
DeadReferenceElimination::DeadReferenceElimination()
1✔
9
    : Pass() {
1✔
10

11
      };
1✔
12

13
std::string DeadReferenceElimination::name() { return "DeadReferenceElimination"; };
×
14

15
bool DeadReferenceElimination::
16
    run_pass(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager) {
×
17
    bool applied = false;
×
18

19
    auto& sdfg = builder.subject();
×
20
    auto& users = analysis_manager.get<analysis::Users>();
×
21

22
    std::list<std::string> to_delete;
×
23
    for (auto& name : sdfg.containers()) {
×
24
        if (!sdfg.is_transient(name)) {
×
25
            continue;
×
26
        }
NEW
27
        auto& type = sdfg.type(name);
×
NEW
28
        if (!dynamic_cast<const types::Pointer*>(&type)) {
×
UNCOV
29
            continue;
×
30
        }
NEW
31
        if (type.storage_type().allocation() == types::StorageType::AllocationType::Managed ||
×
NEW
32
            type.storage_type().deallocation() == types::StorageType::AllocationType::Managed) {
×
NEW
33
            continue;
×
34
        }
35

36
        // Requirement: Pointer is only assigned
37
        auto reads = users.reads(name);
×
38
        auto writes = users.writes(name);
×
39
        if (reads.size() > 0 || writes.size() > 0) {
×
40
            continue;
×
41
        }
42
        auto views = users.views(name);
×
43
        auto moves = users.moves(name);
×
44
        if (views.size() > 0) {
×
45
            continue;
×
46
        }
47

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

56
        to_delete.push_back(name);
×
57
    }
×
58
    for (auto& name : to_delete) {
×
59
        builder.remove_container(name);
×
60
    }
61

62
    return applied;
×
63
};
×
64

65
} // namespace passes
66
} // 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