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

daisytuner / docc / 23958770921

03 Apr 2026 07:13PM UTC coverage: 64.782% (-0.03%) from 64.815%
23958770921

Pull #643

github

web-flow
Merge 05adaeb24 into 951590cfc
Pull Request #643: Replaces LoopNormalization by LoopNormalForm pass

110 of 184 new or added lines in 2 files covered. (59.78%)

5 existing lines in 2 files now uncovered.

29108 of 44932 relevant lines covered (64.78%)

561.63 hits per line

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

88.89
/opt/src/passes/normalization/loop_normal_form.cpp
1
#include "sdfg/passes/normalization/loop_normal_form.h"
2

3
#include "sdfg/transformations/loop_condition_normalize.h"
4
#include "sdfg/transformations/loop_rotate.h"
5
#include "sdfg/transformations/loop_shift.h"
6
#include "sdfg/transformations/loop_unit_stride.h"
7

8
namespace sdfg {
9
namespace passes {
10
namespace normalization {
11

12
LoopNormalForm::LoopNormalForm(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager)
13
    : visitor::NonStoppingStructuredSDFGVisitor(builder, analysis_manager) {};
23✔
14

15
bool LoopNormalForm::accept(structured_control_flow::For& loop) { return this->apply(loop); };
23✔
16

17
bool LoopNormalForm::accept(structured_control_flow::Map& loop) { return this->apply(loop); };
3✔
18

19
bool LoopNormalForm::apply(structured_control_flow::StructuredLoop& loop) {
26✔
20
    bool applied = false;
26✔
21

22
    // Step 1: Shift loop to start from 0
23
    transformations::LoopShift loop_shift(loop);
26✔
24
    if (loop_shift.can_be_applied(builder_, analysis_manager_)) {
26✔
25
        loop_shift.apply(builder_, analysis_manager_);
7✔
26
        applied = true;
7✔
27
    }
7✔
28

29
    // Step 2: Convert non-unit stride to unit stride
30
    transformations::LoopUnitStride loop_unit_stride(loop);
26✔
31
    if (loop_unit_stride.can_be_applied(builder_, analysis_manager_)) {
26✔
32
        loop_unit_stride.apply(builder_, analysis_manager_);
6✔
33
        applied = true;
6✔
34
    }
6✔
35

36
    // Step 3: Convert != conditions to < or > (requires unit stride)
37
    transformations::LoopConditionNormalize loop_cond_normalize(loop);
26✔
38
    if (loop_cond_normalize.can_be_applied(builder_, analysis_manager_)) {
26✔
NEW
39
        loop_cond_normalize.apply(builder_, analysis_manager_);
×
NEW
40
        applied = true;
×
NEW
41
    }
×
42

43
    // Step 4: Convert negative stride to positive (requires < or > conditions)
44
    transformations::LoopRotate loop_rotate(loop);
26✔
45
    if (loop_rotate.can_be_applied(builder_, analysis_manager_)) {
26✔
46
        loop_rotate.apply(builder_, analysis_manager_);
2✔
47
        applied = true;
2✔
48
    }
2✔
49

50
    return applied;
26✔
51
};
26✔
52

53

54
} // namespace normalization
55
} // namespace passes
56
} // 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