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

daisytuner / sdfglib / 17368505925

01 Sep 2025 05:29AM UTC coverage: 58.982% (-0.8%) from 59.781%
17368505925

push

github

web-flow
Merge pull request #216 from daisytuner/transitions-bug

Updates API for Sequence transitions to prevent leakage of assignments

239 of 547 new or added lines in 25 files covered. (43.69%)

75 existing lines in 12 files now uncovered.

9190 of 15581 relevant lines covered (58.98%)

115.89 hits per line

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

78.38
/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
                }
NEW
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