![]() |
OTAWA
2.0
Framework to perform machine analysis and compute WCET.
|
#include <otawa/cfg/LoopReductor.h>
Public Member Functions | |
void * | interfaceFor (const AbstractFeature &f) override |
Get the interface corresponding to the given feature. More... | |
LoopReductor (p::declare &r=reg) | |
![]() | |
virtual void | configure (const PropList &props) |
This method may be called for configuring a processor thanks to information passed in the property list. More... | |
elm::String | name (void) const |
Processor (AbstractRegistration ®istration) | |
For internal use only. More... | |
Processor (const PropList &props) | |
Build a new processor. More... | |
Processor (elm::String name, elm::Version version, const PropList &props) | |
Build a new processor with name and version. More... | |
Processor (String name, Version version) | |
Build a new processor with name and version. More... | |
Processor (String name, Version version, AbstractRegistration ®istration) | |
For internal use only. More... | |
Processor (void) | |
Build a simple anonymous processor. More... | |
AbstractRegistration & | registration (void) const |
elm::Version | version (void) const |
virtual | ~Processor (void) |
![]() | |
void | configure (const PropList &props, string name="") |
bool | isQuiet () const |
bool | isVerbose () const |
bool | logFor (log_level_t tested) const |
log_level_t | logLevel (void) const |
Monitor () | |
Monitor (Monitor &mon) | |
Build a monitor by copy. More... | |
WorkSpace * | workspace (void) |
~Monitor () | |
Static Public Attributes | |
static p::declare | reg |
![]() | |
static p::id< bool > | COLLECT_STATS |
This property allows to activate collection of statistics for the work of the current processor. More... | |
static p::id< elm::io::OutStream * > & | LOG = otawa::LOG |
This property identifier is used for setting the log stream used by the processor to write messages (information, warning, error). More... | |
static p::id< string > & | LOG_FOR = otawa::LOG_FOR |
Logging message will only be displayed for the named processor. More... | |
static p::id< log_level_t > & | LOG_LEVEL = otawa::LOG_LEVEL |
Property passed in the configuration property list of a processor to select the log level between LOG_PROC, LOG_CFG or LOG_BB. More... | |
static Processor & | null = _null |
Singleton representing a null processor. More... | |
static p::id< elm::io::OutStream * > & | OUTPUT = otawa::OUTPUT |
This property identifier is used for setting the output stream used by the processor to write results. More... | |
static p::id< Progress * > | PROGRESS |
Record a progress listener for the execution of the processors. More... | |
static p::id< bool > | RECURSIVE |
static p::declare | reg |
static p::id< elm::sys::time_t > | RUNTIME |
This property identifier is used to store in the statistics of a processor the overall run time of the processor work. More... | |
static p::id< PropList * > | STATS |
This property identifiers is used to pass a property list to the processor that will be used to store statistics about the performed work. More... | |
static p::id< bool > | TIMED |
If the value of the associated property is true (default to false), time statistics will also be collected with other processor statistics. More... | |
static p::id< bool > & | VERBOSE = otawa::VERBOSE |
This property activates the verbose mode of the processor: information about the processor work will be displayed. More... | |
![]() | |
static Monitor & | null = __null_mon |
Monitor that output nothing. More... | |
Protected Member Functions | |
void | commit (WorkSpace *ws) override |
This processor is called as soon as all the required and invalidated features has been removed to let the processor install its own properties. More... | |
void | destroy (WorkSpace *ws) override |
This method is called when the properties produced by a processor are no more useful and can be release. More... | |
void | processWorkSpace (WorkSpace *ws) override |
Process the given framework. More... | |
![]() | |
void | addCleaner (const AbstractFeature &feature, Cleaner *cleaner) |
template<class T > | |
void | addDeletor (const AbstractFeature &feature, const Ref< T *, Identifier< T * > > &ref) |
template<class T > | |
void | addRemover (const AbstractFeature &feature, const Ref< T, Identifier< T > > &ref) |
virtual void | cleanup (WorkSpace *ws) |
This method is called after the end of the processor analysis to let it do some clean up. More... | |
virtual void | collectStats (WorkSpace *ws) |
This method is invoked if the user has required to collect statistics about the processor. More... | |
virtual void | dump (WorkSpace *ws, Output &out) |
Function called for debugging purpose when dump properties (otawa::DUMP, otawa::DUMP_FOR) are provided. More... | |
void | invalidate (const AbstractFeature &feature) |
Usually called from a processor constructor, this method records a feature invalidated by the work of the current processor. More... | |
bool | isAllocated (void) const |
bool | isCollectingStats (void) const |
bool | isDone () const |
bool | isDumping () const |
bool | isPrepared (void) const |
bool | isTimed (void) const |
virtual void | prepare (WorkSpace *ws) |
This method called to let the processor customize its requirements according to some generic feature. More... | |
Progress & | progress (void) |
void | provide (const AbstractFeature &feature) |
Usually called from a processor constructor, this method records a feature provided by the work of the current processor. More... | |
void | record (StatCollector *collector) |
Add a statistics collector to the current workspace collection. More... | |
bool | recordsStats (void) const |
void | recordStat (const AbstractFeature &feature, StatCollector *collector) |
Add a statistics collector to the current workspace collection. More... | |
void | require (const AbstractFeature &feature) |
Usually called from a processor constructor, this method records a required feature for the work of the current processor. More... | |
virtual void | requireDyn (WorkSpace *ws, const PropList &props) |
Method called after registration requirements to support dynamic requirements. More... | |
virtual void | setup (WorkSpace *ws) |
This method is called before an anlysis to let the processor do some initialization. More... | |
void | track (Cleaner *cleaner) |
Track the given cleaner, that is, record the cleaner in the analysis and trigger when the analysis is deleted. More... | |
template<class T > | |
void | track (const AbstractFeature &feature, const Ref< T *, const Identifier< T * > > &ref) |
template<class T > | |
void | track (const AbstractFeature &feature, const Ref< T *, Identifier< T * > > &ref) |
template<class T > | |
void | track (const AbstractFeature &feature, const Ref< T, const Identifier< T > > &ref) |
template<class T > | |
void | track (const AbstractFeature &feature, const Ref< T, Identifier< T > > &ref) |
template<class T > | |
T * | track (const AbstractFeature &feature, T *object) |
template<class T > | |
void | track (const Ref< T *, const Identifier< T * > > &ref) |
template<class T > | |
void | track (const Ref< T, const Identifier< T > > &ref) |
template<class T > | |
T * | track (T *object) |
void | use (const AbstractFeature &feature) |
Usually called from a processor constructor, this method records a feature as used by the work of the current processor. More... | |
void | warn (const String &message) |
Display a warning. More... | |
WorkSpace * | workspace (void) const |
![]() | |
void | setWorkspace (WorkSpace *workspace) |
Update the workspace in the monitor. More... | |
Private Types | |
typedef Vector< dfa::BitSet * > | loops_t |
Private Member Functions | |
Block * | clone (CFGMaker &G, Block *b, bool duplicate=false) |
Duplicate the given block. More... | |
void | computeInLoops (CFGMaker &maker, loops_t &L) |
Compute IN_LOOPS properties and computes the list of loop entries. More... | |
bool | reduce (CFGMaker &G, loops_t &L) |
Reduce irregular loops. More... | |
Private Attributes | |
CFGCollection * | coll |
Vector< CFGMaker * > | vcfgvec |
Static Private Attributes | |
static Identifier< Block * > | DUPLICATE_OF |
static Identifier< dfa::BitSet * > | IN_LOOPS |
static Identifier< bool > | MARK |
Additional Inherited Members | |
![]() | |
enum | log_level_t { LOG_NONE = 0, LOG_PROC = 1, LOG_FILE = 2, LOG_DEPS = LOG_FILE, LOG_FUN = 3, LOG_CFG = LOG_FUN, LOG_BLOCK = 4, LOG_BB = LOG_BLOCK, LOG_INST = 5 } |
typedef enum otawa::Monitor::log_level_t | log_level_t |
![]() | |
elm::io::Output | log |
elm::io::Output | out |
![]() | |
PropList * | stats |
![]() | |
t::uint32 | flags |
![]() | |
static const t::uint32 | CLOSE_DUMP = 0x100 << CUSTOM_SHIFT |
static const t::uint32 | IS_ALLOCATED = 0x004 << CUSTOM_SHIFT |
static const t::uint32 | IS_COLLECTING = 0x010 << CUSTOM_SHIFT |
static const t::uint32 | IS_DONE = 0x040 << CUSTOM_SHIFT |
static const t::uint32 | IS_DUMPING = 0x080 << CUSTOM_SHIFT |
static const t::uint32 | IS_PREPARED = 0x008 << CUSTOM_SHIFT |
static const t::uint32 | IS_TIED = 0x020 << CUSTOM_SHIFT |
static const t::uint32 | IS_TIMED = 0x001 << CUSTOM_SHIFT |
![]() | |
static const t::uint32 | CUSTOM_SHIFT = 16 |
static const t::uint32 | IS_QUIET = 0x02 |
static const t::uint32 | IS_VERBOSE = 0x01 |
|
private |
otawa::LoopReductor::LoopReductor | ( | p::declare & | r = reg | ) |
Duplicate the given block.
maker | CFG maker to use. |
b | Block to duplicate (must not be an end). |
duplicate | If true, the cloned block has already been cloned. |
References otawa::Block::isBasic().
Referenced by reduce().
This processor is called as soon as all the required and invalidated features has been removed to let the processor install its own properties.
This is specially useful when the current processor uses/requires a feature that it is also providing.
The default implementation does nothing.
ws | Current workspace. |
Reimplemented from otawa::Processor.
Compute IN_LOOPS properties and computes the list of loop entries.
maker | CFG to work on. |
L | To store found loops. |
References elm::Vector< class, class, class >::add(), otawa::dfa::BitSet::add(), otawa::sem::add(), otawa::CFGMaker::at(), otawa::CFGMaker::blocks(), cerr, elm::Vector< class, class, class >::clear(), otawa::dfa::BitSet::contains(), otawa::CFGMaker::count(), DEBUG, endl, otawa::CFGMaker::entry(), IN_LOOPS, otawa::graph::Vertex::index(), elm::Vector< class, class, class >::length(), otawa::Monitor::log, otawa::Monitor::LOG_BLOCK, otawa::Monitor::logFor(), otawa::graph::GenVertex< V, E >::outs(), p(), elm::pair(), elm::Vector< class, class, class >::pop(), elm::Vector< class, class, class >::push(), otawa::dfa::BitSet::remove(), elm::Vector< class, class, class >::setLength(), and elm::Vector< class, class, class >::top().
This method is called when the properties produced by a processor are no more useful and can be release.
This happens (a) when the workspace is release or (b) the features provided by the processor are invalidated.
The processor has to retain the properties of the provided features until this function is called.
The default implementation activates the clean list.
Reimplemented from otawa::Processor.
References coll, otawa::ENTRY_CFG, otawa::INVOLVED_CFGS, and otawa::Processor::ws.
|
overridevirtual |
Get the interface corresponding to the given feature.
The feature can only be part of the processor provided feature. This function can only be called once the processor has been executed.
feature | Feature of the looked interface. |
Reimplemented from otawa::Processor.
References coll.
|
overrideprotectedvirtual |
Process the given framework.
fw | Framework to process. |
Reimplemented from otawa::Processor.
References otawa::INVOLVED_CFGS, and otawa::Processor::ws.
Reduce irregular loops.
G | Graph to process. |
L | List of header loops. |
References elm::Vector< class, class, class >::add(), otawa::dfa::BitSet::add(), otawa::CFGMaker::add(), otawa::CFGMaker::at(), otawa::CFGMaker::blocks(), clone(), otawa::dfa::BitSet::contains(), otawa::dfa::BitSet::count(), otawa::CFGMaker::count(), otawa::dfa::BitSet::empty(), endl, IN_LOOPS, otawa::graph::Vertex::index(), otawa::graph::GenVertex< V, E >::ins(), otawa::Monitor::log, otawa::Monitor::LOG_BLOCK, otawa::Monitor::LOG_FUN, otawa::Monitor::logFor(), map(), otawa::graph::GenVertex< V, E >::outs(), elm::Vector< class, class, class >::pop(), and elm::swap().
|
private |
Referenced by commit(), destroy(), and interfaceFor().
|
staticprivate |
|
staticprivate |
Referenced by computeInLoops(), and reduce().
|
staticprivate |
|
static |