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

daisytuner / sdfglib / 15612270835

12 Jun 2025 01:44PM UTC coverage: 60.871% (-0.8%) from 61.71%
15612270835

push

github

web-flow
Merge pull request #68 from daisytuner/loop-types

refactors symbolic analysis into polynomials, extreme values and cnf

638 of 862 new or added lines in 24 files covered. (74.01%)

334 existing lines in 20 files now uncovered.

6571 of 10795 relevant lines covered (60.87%)

100.35 hits per line

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

0.0
/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

UNCOV
8
SequenceFusion::SequenceFusion()
×
UNCOV
9
    : Pass() {
×
10

UNCOV
11
      };
×
12

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

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

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

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

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

UNCOV
58
    return applied;
×
UNCOV
59
};
×
60

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