• 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

47.69
/sdfg/src/data_flow/library_nodes/stdlib/memmove.cpp
1
#include "sdfg/data_flow/library_nodes/stdlib/memmove.h"
2

3
namespace sdfg {
4
namespace stdlib {
5

6
MemmoveNode::MemmoveNode(
7
    size_t element_id,
8
    const DebugInfo& debug_info,
9
    const graph::Vertex vertex,
10
    data_flow::DataFlowGraph& parent,
11
    const symbolic::Expression count
12
)
13
    : StdlibNode(
8✔
14
          element_id,
8✔
15
          debug_info,
8✔
16
          vertex,
8✔
17
          parent,
8✔
18
          LibraryNodeType_Memmove,
8✔
19
          {},
8✔
20
          {"_dst", "_src"},
8✔
21
          true,
8✔
22
          data_flow::ImplementationType_NONE
8✔
23
      ),
8✔
24
      count_(count) {}
8✔
25

26
const symbolic::Expression MemmoveNode::count() const { return count_; }
4✔
27

28
void MemmoveNode::validate(const Function& function) const { LibraryNode::validate(function); }
6✔
29

30
symbolic::SymbolSet MemmoveNode::symbols() const {
2✔
31
    auto count_symbols = symbolic::atoms(this->count_);
2✔
32
    return count_symbols;
2✔
33
}
2✔
34

35
std::unique_ptr<data_flow::DataFlowNode> MemmoveNode::
36
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
37
    return std::make_unique<MemmoveNode>(element_id, debug_info_, vertex, parent, count_);
×
38
}
×
39

40
void MemmoveNode::replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) {
×
41
    this->count_ = symbolic::subs(this->count_, old_expression, new_expression);
×
42
}
×
43

44
nlohmann::json MemmoveNodeSerializer::serialize(const data_flow::LibraryNode& library_node) {
×
45
    const MemmoveNode& node = static_cast<const MemmoveNode&>(library_node);
×
46

47
    nlohmann::json j;
×
48
    j["code"] = node.code().value();
×
49

50
    sdfg::serializer::JSONSerializer serializer;
×
51
    j["count"] = serializer.expression(node.count());
×
52

53
    return j;
×
54
}
×
55

56
data_flow::LibraryNode& MemmoveNodeSerializer::deserialize(
57
    const nlohmann::json& j, builder::StructuredSDFGBuilder& builder, structured_control_flow::Block& parent
58
) {
×
59
    assert(j.contains("code"));
×
60
    assert(j.contains("debug_info"));
×
61
    assert(j.contains("count"));
×
62

63
    auto code = j["code"].get<std::string>();
×
64
    if (code != LibraryNodeType_Memmove.value()) {
×
65
        throw InvalidSDFGException("Invalid library node code");
×
66
    }
×
67

68
    // Extract debug info using JSONSerializer
69
    sdfg::serializer::JSONSerializer serializer;
×
70
    DebugInfo debug_info = serializer.json_to_debug_info(j["debug_info"]);
×
71

72
    // Extract properties
73
    auto count = symbolic::parse(j.at("count"));
×
74

75
    return builder.add_library_node<MemmoveNode>(parent, debug_info, count);
×
76
}
×
77

78
MemmoveNodeDispatcher::MemmoveNodeDispatcher(
79
    codegen::LanguageExtension& language_extension,
80
    const Function& function,
81
    const data_flow::DataFlowGraph& data_flow_graph,
82
    const MemmoveNode& node
83
)
84
    : codegen::LibraryNodeDispatcher(language_extension, function, data_flow_graph, node) {}
×
85

86
void MemmoveNodeDispatcher::dispatch_code_with_edges(
87
    codegen::CodegenOutput& out,
88
    std::vector<codegen::DispatchInput>& inputs,
89
    std::vector<codegen::DispatchOutput>& outputs
90
) {
×
91
    auto& node = static_cast<const MemmoveNode&>(node_);
×
92

NEW
93
    out.stream << language_extension_.external_prefix() << "memmove(" << inputs.at(0).expr << ", " << inputs.at(1).expr
×
NEW
94
               << ", " << language_extension_.expression(node.count()) << ")" << ";";
×
NEW
95
    out.stream << std::endl;
×
NEW
96
}
×
97

98
MemmoveNode& add_memmove_node(
99
    builder::StructuredSDFGBuilder& builder,
100
    Block& block,
101
    const std::string& src_ptr,
102
    const std::string& dst_ptr,
103
    const symbolic::Expression& count,
104
    const types::IType& ptr_type,
105
    DebugInfo debug_info
106
) {
8✔
107
    auto& src_ptr_access = builder.add_access(block, src_ptr);
8✔
108
    auto& dst_ptr_access = builder.add_access(block, dst_ptr);
8✔
109
    auto& libnode = builder.add_library_node<stdlib::MemmoveNode>(block, debug_info, count);
8✔
110
    builder.add_computational_memlet(block, src_ptr_access, libnode, "_src", {}, ptr_type);
8✔
111
    builder.add_computational_memlet(block, dst_ptr_access, libnode, "_dst", {}, ptr_type);
8✔
112

113
    return static_cast<MemmoveNode&>(libnode);
8✔
114
}
8✔
115

116
std::tuple<Block&, MemmoveNode&> add_memmove_block(
117
    builder::StructuredSDFGBuilder& builder,
118
    Sequence& parent,
119
    const std::string& src_ptr,
120
    const std::string& dst_ptr,
121
    const symbolic::Expression& count,
122
    const types::IType& ptr_type,
123
    DebugInfo debug_info
124
) {
8✔
125
    auto& block = builder.add_block(parent);
8✔
126

127
    auto& libnode = add_memmove_node(builder, block, src_ptr, dst_ptr, count, ptr_type, debug_info);
8✔
128

129
    return {block, libnode};
8✔
130
}
8✔
131

132
} // namespace stdlib
133
} // 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