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

daisytuner / sdfglib / 20147202960

11 Dec 2025 08:57PM UTC coverage: 40.181% (-0.09%) from 40.268%
20147202960

push

github

lukastruemper
removes timing outputs of passes

13596 of 43795 branches covered (31.04%)

Branch coverage included in aggregate %.

11609 of 18933 relevant lines covered (61.32%)

93.45 hits per line

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

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

3
#include "sdfg/structured_control_flow/structured_loop.h"
4

5
namespace sdfg {
6
namespace passes {
7

8
SequenceFusion::SequenceFusion()
5✔
9
    : Pass() {
5✔
10

11
      };
5✔
12

13
std::string SequenceFusion::name() { return "SequenceFusion"; };
×
14

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

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

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

40
        // Add children to queue
41
        if (auto sequence_stmt = dynamic_cast<structured_control_flow::Sequence*>(current)) {
28!
42
            for (size_t i = 0; i < sequence_stmt->size(); i++) {
28!
43
                queue.push_back(&sequence_stmt->at(i).first);
16!
44
            }
16✔
45
        } else if (auto if_else_stmt = dynamic_cast<structured_control_flow::IfElse*>(current)) {
28!
46
            for (size_t i = 0; i < if_else_stmt->size(); i++) {
×
47
                queue.push_back(&if_else_stmt->at(i).first);
×
48
            }
×
49
        } else if (auto loop_stmt = dynamic_cast<structured_control_flow::While*>(current)) {
16!
50
            queue.push_back(&loop_stmt->root());
×
51
        } else if (auto sloop_stmt = dynamic_cast<structured_control_flow::StructuredLoop*>(current)) {
16!
52
            queue.push_back(&sloop_stmt->root());
8!
53
        }
8✔
54
    }
55

56
    return applied;
4✔
57
};
4✔
58

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