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

daisytuner / sdfglib / 15044057891

15 May 2025 11:42AM UTC coverage: 59.37% (+1.8%) from 57.525%
15044057891

push

github

web-flow
Merge pull request #14 from daisytuner/sanitizers

enables sanitizer on unit tests

63 of 67 new or added lines in 47 files covered. (94.03%)

570 existing lines in 62 files now uncovered.

7356 of 12390 relevant lines covered (59.37%)

505.93 hits per line

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

87.18
/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()) {
81✔
20
        auto current = queue.front();
72✔
21
        queue.pop_front();
72✔
22

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

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