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

daisytuner / sdfglib / 20263852258

16 Dec 2025 09:58AM UTC coverage: 40.086% (-0.2%) from 40.252%
20263852258

push

github

web-flow
Merge pull request #392 from daisytuner/for2map-performance

refactors passes to improve performance

13621 of 43972 branches covered (30.98%)

Branch coverage included in aggregate %.

126 of 173 new or added lines in 14 files covered. (72.83%)

55 existing lines in 8 files now uncovered.

11633 of 19027 relevant lines covered (61.14%)

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

NEW
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