CACAO
|
ConstantPropagationPass. More...
Public Member Functions | |
ConstantPropagationPass () | |
virtual bool | run (JITData &JD) |
Run the Pass. More... | |
virtual PassUsage & | get_PassUsage (PassUsage &PA) const |
Set the requirements for the pass. More... | |
![]() | |
Pass () | |
void | set_PassManager (PassManager *PM) |
template<class _PassClass > | |
_PassClass * | get_Pass () const |
Get the result of a previous compiler pass. More... | |
template<class _PassClass > | |
_PassClass * | get_Pass_if_available () const |
Get the result of a previous compiler pass. More... | |
virtual void | initialize () |
Initialize the Pass. More... | |
virtual void | finalize () |
Finalize the Pass. More... | |
virtual bool | verify () const |
Verify the Result. More... | |
virtual | ~Pass () |
Destructor. More... | |
Static Public Attributes | |
static char | ID = 0 |
Private Types | |
typedef unordered_map < Instruction *, bool > | InstBoolMapTy |
typedef unordered_map < Instruction *, std::size_t > | InstIntMapTy |
typedef std::list< Instruction * > | WorkListTy |
Private Member Functions | |
void | replace_by_constant (Instruction *isnt, CONSTInst *c, Method *M) |
void | propagate (Instruction *inst) |
Private Attributes | |
WorkListTy | workList |
This work list is used by the algorithm to store the instructions which have to be reconsidered. More... | |
InstBoolMapTy | inWorkList |
will be used to look up whether an instruction is currently contained in the worklist to avoid inserting an instruction which is already in the list More... | |
InstIntMapTy | constantOperands |
used to track for each instruction the number of its operands which are already known to be constant More... | |
This optimization pass is a combined version of constant folding (a.k.a constant expression evaluation) and constant propagation, based on the algorithm in [8]. Analysis and program transformations in the course of this optimization are targeted at the high-level intermediate representation of the compiler2. It evalutes operations at compile-time, whose operands are all constants and propagates the results of these evaluations as far as possible through the program.
Definition at line 52 of file ConstantPropagationPass.hpp.
|
private |
Definition at line 54 of file ConstantPropagationPass.hpp.
|
private |
Definition at line 55 of file ConstantPropagationPass.hpp.
|
private |
Definition at line 56 of file ConstantPropagationPass.hpp.
|
inline |
Definition at line 82 of file ConstantPropagationPass.hpp.
Set the requirements for the pass.
Reimplemented from cacao::jit::compiler2::Pass.
Definition at line 353 of file ConstantPropagationPass.cpp.
|
private |
Definition at line 249 of file ConstantPropagationPass.cpp.
|
private |
Definition at line 261 of file ConstantPropagationPass.cpp.
|
virtual |
Run the Pass.
This method implements the compiler pass.
Implements cacao::jit::compiler2::Pass.
Definition at line 308 of file ConstantPropagationPass.cpp.
|
private |
used to track for each instruction the number of its operands which are already known to be constant
Definition at line 75 of file ConstantPropagationPass.hpp.
|
static |
Definition at line 81 of file ConstantPropagationPass.hpp.
|
private |
will be used to look up whether an instruction is currently contained in the worklist to avoid inserting an instruction which is already in the list
Definition at line 69 of file ConstantPropagationPass.hpp.
|
private |
This work list is used by the algorithm to store the instructions which have to be reconsidered.
at the beginning it therefore contains all instructions.
Definition at line 63 of file ConstantPropagationPass.hpp.