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

daisytuner / sdfglib / 20241896885

15 Dec 2025 05:44PM UTC coverage: 40.075% (-0.2%) from 40.251%
20241896885

Pull #392

github

web-flow
Merge 1719a4ffa into e5e8aa90d
Pull Request #392: refactors passes to improve performance

13609 of 43928 branches covered (30.98%)

Branch coverage included in aggregate %.

26 of 47 new or added lines in 3 files covered. (55.32%)

51 existing lines in 6 files now uncovered.

11621 of 19029 relevant lines covered (61.07%)

92.92 hits per line

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

0.0
/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

UNCOV
8
DeadReferenceElimination::DeadReferenceElimination()
×
UNCOV
9
    : Pass() {
×
10

UNCOV
11
      };
×
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
        }
27
        auto& type = sdfg.type(name);
×
28
        if (!dynamic_cast<const types::Pointer*>(&type)) {
×
29
            continue;
×
30
        }
31
        if (type.storage_type().allocation() == types::StorageType::AllocationType::Managed ||
×
32
            type.storage_type().deallocation() == types::StorageType::AllocationType::Managed) {
×
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