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

daisytuner / sdfglib / 19442734721

17 Nov 2025 07:57PM UTC coverage: 62.167% (+0.01%) from 62.157%
19442734721

push

github

web-flow
Merge pull request #352 from daisytuner/reference-simplify

adds pass to eliminate opaque pointers in reference memlets

26 of 39 new or added lines in 4 files covered. (66.67%)

11103 of 17860 relevant lines covered (62.17%)

112.63 hits per line

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

76.0
/src/passes/dataflow/trivial_reference_conversion.cpp
1
#include "sdfg/passes/dataflow/trivial_reference_conversion.h"
2

3
#include <unordered_set>
4

5
#include "sdfg/analysis/analysis.h"
6
#include "sdfg/analysis/users.h"
7
#include "sdfg/builder/structured_sdfg_builder.h"
8
#include "sdfg/data_flow/access_node.h"
9
#include "sdfg/data_flow/data_flow_graph.h"
10
#include "sdfg/data_flow/memlet.h"
11
#include "sdfg/data_flow/tasklet.h"
12
#include "sdfg/element.h"
13
#include "sdfg/structured_control_flow/block.h"
14
#include "sdfg/structured_control_flow/control_flow_node.h"
15
#include "sdfg/structured_control_flow/if_else.h"
16
#include "sdfg/structured_control_flow/sequence.h"
17
#include "sdfg/structured_control_flow/structured_loop.h"
18
#include "sdfg/types/type.h"
19
#include "sdfg/visitor/structured_sdfg_visitor.h"
20

21
namespace sdfg {
22
namespace passes {
23

24

25
TrivialReferenceConversion::
26
    TrivialReferenceConversion(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager)
2✔
27
    : visitor::NonStoppingStructuredSDFGVisitor(builder, analysis_manager) {};
2✔
28

29
bool TrivialReferenceConversion::accept(structured_control_flow::Block& block) {
3✔
30
    bool applied = false;
3✔
31
    auto& dfg = block.dataflow();
3✔
32

33
    // Narrow type of reference memlets to int8
34
    for (auto& edge : dfg.edges()) {
6✔
35
        // Find memlets that are references
36
        if (edge.type() != data_flow::MemletType::Reference) {
3✔
NEW
37
            continue;
×
38
        }
39
        if (edge.subset().size() != 1) {
3✔
NEW
40
            continue;
×
41
        }
42
        if (!symbolic::eq(edge.subset().at(0), symbolic::zero())) {
3✔
43
            continue;
1✔
44
        }
45
        auto& base_type = edge.base_type();
2✔
46
        if (base_type.type_id() != types::TypeID::Pointer) {
2✔
NEW
47
            continue;
×
48
        }
49
        auto& base_type_ptr = static_cast<const types::Pointer&>(base_type);
2✔
50
        if (!base_type_ptr.has_pointee_type()) {
2✔
NEW
51
            continue;
×
52
        }
53
        auto& pointee_type = base_type_ptr.pointee_type();
2✔
54
        if (pointee_type.type_id() != types::TypeID::Pointer) {
2✔
NEW
55
            continue;
×
56
        }
57
        edge.set_base_type(types::Pointer(types::Scalar(types::PrimitiveType::Int8)));
2✔
58
        applied = true;
2✔
59
    }
60

61
    return applied;
3✔
NEW
62
}
×
63

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