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

daisytuner / sdfglib / 20764569418

06 Jan 2026 10:50PM UTC coverage: 62.168% (+21.4%) from 40.764%
20764569418

push

github

web-flow
Merge pull request #433 from daisytuner/clang-coverage

updates clang coverage flags

14988 of 24109 relevant lines covered (62.17%)

88.57 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

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

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
        if (users.num_reads(name) > 0 || users.num_writes(name) > 0) {
×
38
            continue;
×
39
        }
×
40
        if (users.num_views(name) > 0) {
×
41
            continue;
×
42
        }
×
43

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

53
        to_delete.push_back(name);
×
54
    }
×
55
    for (auto& name : to_delete) {
×
56
        builder.remove_container(name);
×
57
    }
×
58

59
    return applied;
×
60
};
×
61

62
} // namespace passes
63
} // 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