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

daisytuner / docc / 26556322966

27 May 2026 03:45PM UTC coverage: 60.869% (-0.02%) from 60.886%
26556322966

push

github

web-flow
Libnode ptr edges (#719)

Migrating SDFGs to treat pointers as inputs to libNodes / Calls as scalars.
A pointer will only appear in an output edge if its actually returned from the function (like malloc).

* Stdlib, Blas and Tensor Matmul nodes were migrated to this new format. Other, currently transitory Tensor Nodes are not yet migrated.
* DOCC version was bumped to incorporate previous docc-llvm versions (up to 0.4.0) that had been counted separately.
! Until all passes consider the use / leak of pointers as uncertainty / hiding potential writes, TensorNodes are declared as general side-effect.
* Lots of utility functions to centralize the creation (and edges) of various libNodes that needed to be changed.
* Fixed & unified docc paths across python and llvm front-ends.
* Skip BlockFusion test that fails to its libNodes currently having side effects
~ Prevent a crash in DotViz when using symbolic offsets into structs
* Removing old ConstProp pass, it is not safe for the new pointer representation and should not be all too critical

961 of 1749 new or added lines in 52 files covered. (54.95%)

87 existing lines in 28 files now uncovered.

35225 of 57870 relevant lines covered (60.87%)

11046.32 hits per line

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

46.15
/sdfg/src/data_flow/library_node.cpp
1
#include "sdfg/data_flow/library_node.h"
2

3
#include <string>
4
#include "sdfg/data_flow/data_flow_graph.h"
5
#include "sdfg/symbolic/symbolic.h"
6
#include "symengine/symengine_rcp.h"
7

8
namespace sdfg {
9
namespace data_flow {
10

11
LibraryNode::LibraryNode(
12
    size_t element_id,
13
    const DebugInfo& debug_info,
14
    const graph::Vertex vertex,
15
    DataFlowGraph& parent,
16
    const LibraryNodeCode& code,
17
    const std::vector<std::string>& outputs,
18
    const std::vector<std::string>& inputs,
19
    const bool side_effect,
20
    const ImplementationType& implementation_type
21
)
22
    : CodeNode(element_id, debug_info, vertex, parent, outputs, inputs), code_(code), side_effect_(side_effect),
1,420✔
23
      implementation_type_(implementation_type) {}
1,420✔
24

25
const LibraryNodeCode& LibraryNode::code() const { return this->code_; };
373✔
26

27
const ImplementationType& LibraryNode::implementation_type() const { return this->implementation_type_; };
13✔
28

29
ImplementationType& LibraryNode::implementation_type() { return this->implementation_type_; };
72✔
30

31
bool LibraryNode::side_effect() const { return this->side_effect_; };
34✔
32

33
std::string LibraryNode::toStr() const { return std::string(this->code_.value()); }
×
34

35
symbolic::Expression LibraryNode::flop() const { return SymEngine::null; }
×
36

37
PointerAccessType LibraryNode::pointer_access_type(const Memlet& edge) const {
11✔
38
    auto& conn = edge.dst_conn();
11✔
39
    auto idx = std::find(inputs_.begin(), inputs_.end(), conn) - inputs_.begin();
11✔
40
    return pointer_access_type(idx);
11✔
41
}
11✔
42

43
EdgeRemoveOption LibraryNode::can_remove_out_edge(const data_flow::DataFlowGraph& graph, const Memlet* memlet) const {
2✔
44
    if (graph.out_edges_for_connector(*this, memlet->src_conn()).size() > 1) {
2✔
45
        return EdgeRemoveOption::Trivially;
×
46
    } else if (!side_effect_ && outputs_.size() == 1) {
2✔
47
        return EdgeRemoveOption::RemoveNodeAfter;
×
48
    } else {
2✔
49
        // cannot remove the last edge per connector in general
50
        return EdgeRemoveOption::NotRemovable;
2✔
51
    }
2✔
52
}
2✔
53

NEW
54
EdgeRemoveOption LibraryNode::can_remove_in_edge(const data_flow::DataFlowGraph& graph, const Memlet* memlet) const {
×
NEW
55
    return EdgeRemoveOption::NotRemovable;
×
NEW
56
}
×
57

NEW
58
bool LibraryNode::pointer_use_creates_side_effects(const DataFlowGraph& dataflow, const Function& func) {
×
NEW
59
    for (int i = 0; i < inputs_.size(); ++i) {
×
NEW
60
        auto& conn = inputs_.at(i);
×
NEW
61
        auto* edge = dataflow.in_edge_for_connector(*this, conn);
×
NEW
62
        if (edge && edge->result_type(func)->type_id() == types::TypeID::Pointer) {
×
NEW
63
            auto access = pointer_access_type(i);
×
NEW
64
            if (!access || !access->no_capture() || (access->may_contain_reads() && !access->access_read_pattern()) ||
×
NEW
65
                (access->may_contain_writes() && !access->access_write_pattern())) {
×
NEW
66
                return true;
×
NEW
67
            }
×
NEW
68
        }
×
NEW
69
    }
×
NEW
70
    return false;
×
NEW
71
}
×
72

73
} // namespace data_flow
74
} // 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