Otawa  0.10
LoopUnroller.h
Go to the documentation of this file.
1 /*
2  * LoopUnroller processor interface
3  *
4  * This file is part of OTAWA
5  * Copyright (c) 2007, IRIT UPS.
6  *
7  * OTAWA is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * OTAWA is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OTAWA; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA
21  */
22 
23 #ifndef OTAWA_CFG_LOOPUNROLLER_H_
24 #define OTAWA_CFG_LOOPUNROLLER_H_
25 
26 #include <otawa/proc/Processor.h>
27 #include <otawa/cfg/VirtualCFG.h>
28 #include <otawa/cfg/CFGCollector.h>
30 #include <elm/genstruct/HashTable.h>
31 #include <otawa/proc/Feature.h>
32 
33 namespace otawa {
34 
35 // LoopUnroller class
36 class LoopUnroller: public Processor {
37 public:
38  static p::declare reg;
40 
41 protected:
42  virtual void processWorkSpace(WorkSpace *ws);
43  virtual void cleanup(WorkSpace *ws);
44 
45 private:
46  void unroll(otawa::CFG *cfg, BasicBlock *header, VirtualCFG *vcfg);
47 
50  int idx;
51 };
52 
53 } // otawa
54 
55 #endif // OTAWA_CFG_LOOPUNROLLER_H_
56 
virtual void cleanup(WorkSpace *ws)
This method is called after the end of the processor analysis to let it do some clean up...
Definition: cfg_LoopUnroller.cpp:144
virtual void processWorkSpace(WorkSpace *ws)
Process the given framework.
Definition: cfg_LoopUnroller.cpp:104
Class to declare simple a processor.
Definition: Registration.h:213
WorkSpace * ws
Definition: Processor.h:185
This processor unrolls the first iteration of each loop.
Definition: LoopUnroller.h:36
Control Flow Graph representation.
Definition: CFG.h:42
The processor class is implemented by all code processor.
Definition: Processor.h:49
CFGCollection * coll
Definition: LoopUnroller.h:49
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
void unroll(otawa::CFG *cfg, BasicBlock *header, VirtualCFG *vcfg)
Definition: cfg_LoopUnroller.cpp:151
Contains a collection of CFGs (used with INVOLVED_CFGS property).
Definition: features.h:45
A virtual CFG is a CFG not-mapped to real code, that is, it may contains virtual nodes for inlining f...
Definition: VirtualCFG.h:29
dtd::Element cfg(dtd::make("cfg", _CFG).attr(id).content((entry,*bb, exit,*edge)))
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
LoopUnroller(p::declare &r=reg)
Definition: cfg_LoopUnroller.cpp:101
elm::genstruct::HashTable< void *, VirtualBasicBlock * > map
Definition: LoopUnroller.h:48
int idx
Definition: LoopUnroller.h:50
static p::declare reg
Definition: LoopUnroller.h:38