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

daisytuner / sdfglib / 15656007340

14 Jun 2025 08:51PM UTC coverage: 13.234% (-49.9%) from 63.144%
15656007340

Pull #76

github

web-flow
Merge 9586c8161 into 413c53212
Pull Request #76: New Loop Dependency Analysis

361 of 465 new or added lines in 7 files covered. (77.63%)

6215 existing lines in 110 files now uncovered.

1612 of 12181 relevant lines covered (13.23%)

13.64 hits per line

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

0.0
/src/transformations/utils.cpp
1
#include "sdfg/transformations/utils.h"
2

3
#include "sdfg/structured_control_flow/structured_loop.h"
4
#include "sdfg/symbolic/symbolic.h"
5
#include "symengine/logic.h"
6

7
using namespace sdfg;
8

UNCOV
9
symbolic::Integer sdfg::get_iteration_count(sdfg::structured_control_flow::StructuredLoop& loop) {
×
UNCOV
10
    auto condition = loop.condition();
×
11
    // TODO: extend me to support more complex loop conditions and update expressions
UNCOV
12
    if (SymEngine::is_a<SymEngine::And>(*condition)) {
×
13
        auto and_condition = SymEngine::rcp_static_cast<const SymEngine::And>(condition);
×
14
        auto container = and_condition->get_container();
×
15
        for (auto it = container.begin(); it != container.end(); ++it) {
×
16
            if (!SymEngine::is_a<SymEngine::StrictLessThan>(**it)) {
×
17
                return SymEngine::null;
×
18
            }
19
            auto stl = SymEngine::rcp_static_cast<const SymEngine::StrictLessThan>(*it);
×
20
            auto lhs = stl->get_args()[0];
×
21
            auto rhs = stl->get_args()[1];
×
22
            if (!symbolic::eq(lhs, loop.indvar())) {
×
23
                std::swap(lhs, rhs);
×
24
            }
×
25
            if (!symbolic::eq(lhs, loop.indvar())) {
×
26
                continue;
×
27
            }
28
            auto bound = rhs;
×
29
            auto range = symbolic::sub(bound, loop.init());
×
30
            if (SymEngine::is_a<SymEngine::Integer>(*range)) {
×
31
                return SymEngine::rcp_static_cast<const SymEngine::Integer>(range);
×
32
            }
33
        }
×
UNCOV
34
    } else if (SymEngine::is_a<SymEngine::StrictLessThan>(*condition)) {
×
UNCOV
35
        auto stl = SymEngine::rcp_static_cast<const SymEngine::StrictLessThan>(condition);
×
UNCOV
36
        auto lhs = stl->get_args()[0];
×
UNCOV
37
        auto rhs = stl->get_args()[1];
×
UNCOV
38
        if (!symbolic::eq(lhs, loop.indvar())) {
×
39
            std::swap(lhs, rhs);
×
40
        }
×
UNCOV
41
        if (!symbolic::eq(lhs, loop.indvar())) {
×
42
            return SymEngine::null;
×
43
        }
UNCOV
44
        auto bound = rhs;
×
UNCOV
45
        auto range = symbolic::sub(bound, loop.init());
×
UNCOV
46
        if (SymEngine::is_a<SymEngine::Integer>(*range)) {
×
UNCOV
47
            return SymEngine::rcp_static_cast<const SymEngine::Integer>(range);
×
48
        }
UNCOV
49
    }
×
50
    return SymEngine::null;
×
UNCOV
51
};
×
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