|
ESBMC
Efficient SMT-based Context-Bounded Model Checker
|
Global Common Subexpression Elimination algorithm. More...
#include <gcse.h>
Public Member Functions | |
| goto_cse (contextt &ns, std::shared_ptr< value_setst > &vsa) | |
| virtual bool | runOnProgram (goto_functionst &) override |
| virtual bool | runOnFunction (std::pair< const irep_idt, goto_functiont > &F) override |
| Public Member Functions inherited from goto_functions_algorithm | |
| goto_functions_algorithm (bool sideffect) | |
| unsigned | get_number_of_functions () |
| unsigned | get_number_of_loops () |
| bool | run (goto_functionst &) override |
| Executes the algorithm over a T object. | |
| void | setTarget (const std::string &_tgt) |
| Public Member Functions inherited from algorithm< goto_functionst > | |
| algorithm (bool sideeffect) | |
| virtual | ~algorithm ()=default |
| bool | has_sideeffect () |
| Says wether the algorithm is a plain analysis or if it also changes the structure. | |
Protected Member Functions | |
| expr2tc | obtain_max_sub_expr (const expr2tc &e, const cse_domaint &state) const |
| void | replace_max_sub_expr (expr2tc &e, const std::unordered_map< expr2tc, expr2tc, irep2_hash > &expr2symbol, const goto_programt::const_targett &to, std::unordered_set< expr2tc, irep2_hash > &matched_expressions) const |
| void | replace_in_lvalue (expr2tc &lhs, const std::unordered_map< expr2tc, expr2tc, irep2_hash > &expr2symbol, const goto_programt::const_targett &to, std::unordered_set< expr2tc, irep2_hash > &matched_expressions) const |
| Like replace_max_sub_expr, but only in the value operands of an lvalue. | |
| symbolt | create_cse_symbol (const type2tc &t, const goto_programt::const_targett &to) |
| Protected Member Functions inherited from goto_functions_algorithm | |
| virtual bool | runOnLoop (loopst &loop, goto_programt &goto_program) |
Protected Attributes | |
| ait< cse_domaint > | available_expressions |
| contextt & | context |
| Protected Attributes inherited from goto_functions_algorithm | |
| std::string | target_function = "" |
| Protected Attributes inherited from algorithm< goto_functionst > | |
| const bool | sideeffect |
Global Common Subexpression Elimination algorithm.
Compute all common subexpression in a goto program. For each common subexpression, a new intermediate variable __ESBMC_cse_symbol$ is created and assigned to the common value.
In ESBMC, the main advantage is for sequential dereferences/with statements. They generate lots of boilerplate to be dereferenced during symex.
Before: X = a + b + c; Y = a + b + d;
After: __ESBMC_cse_symbol$0 = a + b; X = __ESBMC_cse_symbol$0 + c; Y = __ESBMC_cse_symbol$0 + d;
|
inline |
|
inlineprotected |
|
protected |
|
protected |
Like replace_max_sub_expr, but only in the value operands of an lvalue.
|
protected |
|
overridevirtual |
Reimplemented from goto_functions_algorithm.
|
overridevirtual |
Reimplemented from goto_functions_algorithm.
|
protected |
|
protected |