OpenASIP 2.2
Loading...
Searching...
No Matches
LoopAnalyzer.hh
Go to the documentation of this file.
1#ifndef LOOP_ANALYZER_HH
2#define LOOP_ANALYZER_HH
3
5
7public:
8
9 // MoveNode contains the node that reads the limit from a register,
10 // if limit not constant.
11 // Not just a string with register name to make ddg updates easier when
12 // creating the loop buffer init.
14 LoopAnalysisResult(long iCount = INT_MIN, MoveNode* n = NULL, int cMul = 1) :
16 MoveNode* counterValueNode; // NULL if static
17 long iterationCount; // may be offset to counter value node
18 int counterMultiplier; // if the val is a multiply of iter count.
19 };
20 typedef std::pair<int, MoveNode*> EndCondition;
21
25 int update;
27 InitAndUpdate(int i, int u, bool l) : initNode(NULL), initVal(i), update(u), loopEdge(l) {}
28 InitAndUpdate(MoveNode& mn, int u, bool l) : initNode(&mn), initVal(0), update(u), loopEdge(l) {}
29 InitAndUpdate(MoveNode& mn, int i, int u, bool l) : initNode(&mn), initVal(i), update(u), loopEdge(l) {}
30 };
31 static LoopAnalysisResult*
33
34private:
35 static InitAndUpdate* findInitAndUpdate(DataDependenceGraph& ddg, MoveNode& cmpVal);
36
37 static EndCondition* findEndCond(DataDependenceGraph& ddg, MoveNode& cmpVal, bool allowVariable);
38
40 DataDependenceGraph& ddg, MoveNode& init, MoveNode& endCond);
41};
42
43#endif
static LoopAnalysisResult * analyze(BasicBlockNode &bbn, DataDependenceGraph &ddg)
static InitAndUpdate * findInitAndUpdate(DataDependenceGraph &ddg, MoveNode &cmpVal)
static EndCondition * findEndCond(DataDependenceGraph &ddg, MoveNode &cmpVal, bool allowVariable)
static EndCondition * tryTrackCommonAncestor(DataDependenceGraph &ddg, MoveNode &init, MoveNode &endCond)
std::pair< int, MoveNode * > EndCondition
InitAndUpdate(int i, int u, bool l)
InitAndUpdate(MoveNode &mn, int i, int u, bool l)
InitAndUpdate(MoveNode &mn, int u, bool l)
LoopAnalysisResult(long iCount=INT_MIN, MoveNode *n=NULL, int cMul=1)