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

daisytuner / sdfglib / 15494289007

06 Jun 2025 03:36PM UTC coverage: 57.304% (-0.4%) from 57.704%
15494289007

push

github

web-flow
Merge pull request #60 from daisytuner/kernels

removes kernel node in favor of function types

78 of 99 new or added lines in 11 files covered. (78.79%)

91 existing lines in 14 files now uncovered.

7583 of 13233 relevant lines covered (57.3%)

116.04 hits per line

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

82.05
/src/passes/structured_control_flow/sequence_fusion.cpp
1
#include "sdfg/passes/structured_control_flow/sequence_fusion.h"
2

3
namespace sdfg {
4
namespace passes {
5

6
SequenceFusion::SequenceFusion()
7✔
7
    : Pass() {
7✔
8

9
      };
7✔
10

11
std::string SequenceFusion::name() { return "SequenceFusion"; };
×
12

13
bool SequenceFusion::run_pass(builder::StructuredSDFGBuilder& builder,
9✔
14
                              analysis::AnalysisManager& analysis_manager) {
15
    bool applied = false;
9✔
16

17
    // Traverse structured SDFG
18
    std::list<structured_control_flow::ControlFlowNode*> queue = {&builder.subject().root()};
9✔
19
    while (!queue.empty()) {
73✔
20
        auto current = queue.front();
64✔
21
        queue.pop_front();
64✔
22

23
        // If sequence, attempt fusion
24
        if (auto seq = dynamic_cast<structured_control_flow::Sequence*>(current)) {
64✔
25
            size_t i = 0;
28✔
26
            while (i < seq->size()) {
68✔
27
                auto child = seq->at(i);
40✔
28
                auto subseq = dynamic_cast<structured_control_flow::Sequence*>(&child.first);
40✔
29
                if (!subseq) {
40✔
30
                    i++;
36✔
31
                    continue;
36✔
32
                }
33
                builder.insert_children(*seq, *subseq, i + 1);
4✔
34
                builder.remove_child(*seq, i);
4✔
35
                applied = true;
4✔
36
            }
37
        }
28✔
38

39
        // Add children to queue
40
        if (auto sequence_stmt = dynamic_cast<structured_control_flow::Sequence*>(current)) {
64✔
41
            for (size_t i = 0; i < sequence_stmt->size(); i++) {
64✔
42
                queue.push_back(&sequence_stmt->at(i).first);
36✔
43
            }
36✔
44
        } else if (auto if_else_stmt = dynamic_cast<structured_control_flow::IfElse*>(current)) {
64✔
45
            for (size_t i = 0; i < if_else_stmt->size(); i++) {
×
46
                queue.push_back(&if_else_stmt->at(i).first);
×
47
            }
×
48
        } else if (auto loop_stmt = dynamic_cast<structured_control_flow::While*>(current)) {
36✔
49
            queue.push_back(&loop_stmt->root());
×
50
        } else if (auto for_stmt = dynamic_cast<structured_control_flow::For*>(current)) {
36✔
51
            queue.push_back(&for_stmt->root());
19✔
52
        } else if (auto map_stmt = dynamic_cast<const structured_control_flow::Map*>(current)) {
36✔
UNCOV
53
            queue.push_back(&map_stmt->root());
×
54
        }
×
55
    }
56

57
    return applied;
9✔
58
};
9✔
59

60
}  // namespace passes
61
}  // 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