retdec
pre_while_true_loop_conv_optimizer.h
Go to the documentation of this file.
1 
8 #ifndef RETDEC_LLVMIR2HLL_OPTIMIZER_OPTIMIZERS_PRE_WHILE_TRUE_LOOP_CONV_OPTIMIZER_H
9 #define RETDEC_LLVMIR2HLL_OPTIMIZER_OPTIMIZERS_PRE_WHILE_TRUE_LOOP_CONV_OPTIMIZER_H
10 
13 
14 namespace retdec {
15 namespace llvmir2hll {
16 
17 class ValueAnalysis;
18 class VarUsesVisitor;
19 
121 public:
123 
124  virtual std::string getId() const override { return "PreWhileTrueLoopConv"; }
125 
126 private:
127  virtual void doOptimization() override;
128 
132  virtual void visit(ShPtr<WhileLoopStmt> stmt) override;
134 
140 
141 private:
144 
147 };
148 
149 } // namespace llvmir2hll
150 } // namespace retdec
151 
152 #endif
A base class of all function optimizers.
Definition: func_optimizer.h:44
ShPtr< Module > module
The module that is being optimized.
Definition: optimizer.h:79
virtual void visit(ShPtr< GlobalVarDef > varDef) override
Definition: ordered_all_visitor.cpp:95
Optimizes the bodies of while True loops to simplify other optimizations of these loops.
Definition: pre_while_true_loop_conv_optimizer.h:120
virtual std::string getId() const override
Returns the ID of the optimizer.
Definition: pre_while_true_loop_conv_optimizer.h:124
bool tryOptimizationCase3(ShPtr< WhileLoopStmt > stmt)
Tries the optimization (3) from the class description over the given loop.
Definition: pre_while_true_loop_conv_optimizer.cpp:361
ShPtr< VarUsesVisitor > vuv
Visitor for obtaining uses of variables.
Definition: pre_while_true_loop_conv_optimizer.h:146
bool tryOptimizationCase4(ShPtr< WhileLoopStmt > stmt)
Tries the optimization (4) from the class description over the given loop.
Definition: pre_while_true_loop_conv_optimizer.cpp:450
virtual void doOptimization() override
Performs the optimization on all functions in the module.
Definition: pre_while_true_loop_conv_optimizer.cpp:44
bool tryOptimizationCase5(ShPtr< WhileLoopStmt > stmt)
Tries the optimization (5) from the class description over the given loop.
Definition: pre_while_true_loop_conv_optimizer.cpp:560
bool tryOptimizationCase1(ShPtr< WhileLoopStmt > stmt)
Tries the optimization (1) from the class description over the given loop.
Definition: pre_while_true_loop_conv_optimizer.cpp:87
virtual void visit(ShPtr< GlobalVarDef > varDef) override
Definition: ordered_all_visitor.cpp:95
bool tryOptimizationCase2(ShPtr< WhileLoopStmt > stmt)
Tries the optimization (2) from the class description over the given loop.
Definition: pre_while_true_loop_conv_optimizer.cpp:217
ShPtr< ValueAnalysis > va
Analysis of values.
Definition: pre_while_true_loop_conv_optimizer.h:143
PreWhileTrueLoopConvOptimizer(ShPtr< Module > module, ShPtr< ValueAnalysis > va)
Constructs a new optimizer.
Definition: pre_while_true_loop_conv_optimizer.cpp:37
A base class of all function optimizers.
A library providing API for working with back-end IR.
std::shared_ptr< T > ShPtr
An alias for a shared pointer.
Definition: smart_ptr.h:18
Definition: archive_wrapper.h:19
Declarations, aliases, macros, etc. for the use of smart pointers.