ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
loop_unroll.h
Go to the documentation of this file.
1#ifndef ESBMC_GOTO_ALGORITHMS_H
2#define ESBMC_GOTO_ALGORITHMS_H
3
6#include <unordered_set>
7
19{
20public:
24
25protected:
26 bool runOnLoop(loopst &loop, goto_programt &goto_program) override;
27
34 virtual int get_loop_bounds(loopst &loop) = 0;
35};
36
60{
61public:
69
77 {
78 return number_of_bounded_loops;
79 }
80
81protected:
82 // Sets an upper limit for the quantity of loops
83 const size_t unroll_limit;
84 int get_loop_bounds(loopst &loop) override;
85
86private:
87 unsigned number_of_bounded_loops = 0;
88};
89
112{
113public:
117
118 bool run(goto_functionst &goto_functions) override;
119
120protected:
121 bool runOnLoop(loopst &loop, goto_programt &goto_program) override;
122
123private:
126 bool apply_unroll(goto_programt::targett call, loopst &loop);
127
130 std::unordered_set<const goto_programt::instructiont *> matched_calls;
131};
132
133#endif
apply_intrinsic_unroller()
Definition loop_unroll.h:114
bool runOnLoop(loopst &loop, goto_programt &goto_program) override
Definition loop_unroll.cpp:265
bool run(goto_functionst &goto_functions) override
Executes the algorithm over a T object.
Definition loop_unroll.cpp:299
unsigned get_number_of_bounded_loops()
Get the number of bounded loops that were detected after the algorithm has run.
Definition loop_unroll.h:76
bounded_loop_unroller(size_t unroll_limit=1000)
Note: the default value for unroll_limit is based on testing.
Definition loop_unroll.h:65
int get_loop_bounds(loopst &loop) override
Get the number of iteractions to unroll the loop.
Definition loop_unroll.cpp:72
const size_t unroll_limit
Definition loop_unroll.h:83
goto_functions_algorithm(bool sideffect)
Definition goto_functions_algorithm.h:13
Definition goto_functions.h:56
A generic container class for a control flow graph for one function, in the form of a goto-program.
Definition goto_program.h:63
instructionst::iterator targett
Definition goto_program.h:590
Definition loopst.h:8
virtual int get_loop_bounds(loopst &loop)=0
Get the number of iteractions to unroll the loop.
unsound_loop_unroller()
Definition loop_unroll.h:21
bool runOnLoop(loopst &loop, goto_programt &goto_program) override
Definition loop_unroll.cpp:4
#define true
Definition stdbool.h:11