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... | |
virtual bool | is_enabled () const |
Allows concrete passes to enable/disable themselves the way they like. More... | |
![]() | |
Pass () | |
void | set_PassRunner (PassRunner *pr) |
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 Option< bool > | enabled |
Private Types | |
typedef alloc::unordered_map < Instruction *, bool >::type | InstBoolMapTy |
typedef alloc::unordered_map < Instruction *, std::size_t > ::type | 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... | |
Additional Inherited Members | |
![]() | |
template<class T > | |
static PassInfo::IDTy | ID () |
This template will return a unique ID for each type that it is called with. 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 53 of file ConstantPropagationPass.hpp.
|
private |
Definition at line 55 of file ConstantPropagationPass.hpp.
|
private |
Definition at line 56 of file ConstantPropagationPass.hpp.
|
private |
Definition at line 57 of file ConstantPropagationPass.hpp.
|
inline |
Definition at line 83 of file ConstantPropagationPass.hpp.
Set the requirements for the pass.
Reimplemented from cacao::jit::compiler2::Pass.
Definition at line 354 of file ConstantPropagationPass.cpp.
|
inlinevirtual |
Allows concrete passes to enable/disable themselves the way they like.
Reimplemented from cacao::jit::compiler2::Pass.
Definition at line 87 of file ConstantPropagationPass.hpp.
|
private |
Definition at line 250 of file ConstantPropagationPass.cpp.
|
private |
Definition at line 262 of file ConstantPropagationPass.cpp.
|
virtual |
Run the Pass.
This method implements the compiler pass.
Implements cacao::jit::compiler2::Pass.
Definition at line 309 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 76 of file ConstantPropagationPass.hpp.
|
static |
Definition at line 82 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 70 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 64 of file ConstantPropagationPass.hpp.