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

daisytuner / sdfglib / 15973046991

30 Jun 2025 12:34PM UTC coverage: 64.64% (-0.2%) from 64.86%
15973046991

push

github

web-flow
Merge pull request #123 from daisytuner/simplify-tiling-transformation

Avoid deep copy in loop tiling

31 of 32 new or added lines in 2 files covered. (96.88%)

27 existing lines in 6 files now uncovered.

8643 of 13371 relevant lines covered (64.64%)

171.55 hits per line

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

78.95
/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()
4✔
9
    : Pass() {
4✔
10

11
      };
4✔
12

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

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

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

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

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

58
    return applied;
3✔
59
};
3✔
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

© 2025 Coveralls, Inc