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

daisytuner / sdfglib / 20770413849

06 Jan 2026 10:50PM UTC coverage: 62.168% (+21.4%) from 40.764%
20770413849

push

github

web-flow
Merge pull request #433 from daisytuner/clang-coverage

updates clang coverage flags

14988 of 24109 relevant lines covered (62.17%)

88.57 hits per line

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

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

9
symbolic::Integer sdfg::get_iteration_count(sdfg::structured_control_flow::StructuredLoop& loop) {
2✔
10
    auto condition = loop.condition();
2✔
11
    // TODO: extend me to support more complex loop conditions and update expressions
12
    if (SymEngine::is_a<SymEngine::And>(*condition)) {
2✔
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
        }
×
34
    } else if (SymEngine::is_a<SymEngine::StrictLessThan>(*condition)) {
2✔
35
        auto stl = SymEngine::rcp_static_cast<const SymEngine::StrictLessThan>(condition);
2✔
36
        auto lhs = stl->get_args()[0];
2✔
37
        auto rhs = stl->get_args()[1];
2✔
38
        if (!symbolic::eq(lhs, loop.indvar())) {
2✔
39
            std::swap(lhs, rhs);
×
40
        }
×
41
        if (!symbolic::eq(lhs, loop.indvar())) {
2✔
42
            return SymEngine::null;
×
43
        }
×
44
        auto bound = rhs;
2✔
45
        auto range = symbolic::sub(bound, loop.init());
2✔
46
        if (SymEngine::is_a<SymEngine::Integer>(*range)) {
2✔
47
            return SymEngine::rcp_static_cast<const SymEngine::Integer>(range);
2✔
48
        }
2✔
49
    }
2✔
50
    return SymEngine::null;
×
51
};
2✔
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