add Region constructor and SolveDataflow function
This commit is contained in:
@@ -7,6 +7,8 @@ using std::vector;
|
||||
using std::map;
|
||||
using std::string;
|
||||
using std::set;
|
||||
using std::unordered_set;
|
||||
using std::pair;
|
||||
|
||||
struct ArrayDimension
|
||||
{
|
||||
@@ -36,49 +38,85 @@ class Region: public SAPFOR::BasicBlock {
|
||||
public:
|
||||
Region()
|
||||
{
|
||||
header = nullptr;
|
||||
nextRegion = nullptr;
|
||||
header = nullptr;
|
||||
}
|
||||
|
||||
Region(SAPFOR::BasicBlock block) : SAPFOR::BasicBlock::BasicBlock(block)
|
||||
{
|
||||
header = nullptr;
|
||||
nextRegion = nullptr;
|
||||
};
|
||||
//Region(LoopGraph* loop);
|
||||
Region* GetHeader()
|
||||
}
|
||||
|
||||
Region(LoopGraph* loop, vector<SAPFOR::BasicBlock*>& Blocks);
|
||||
|
||||
Region* getHeader()
|
||||
{
|
||||
return header;
|
||||
}
|
||||
set<Region*> GetBasickBlocks()
|
||||
|
||||
unordered_set<Region*>& getBasickBlocks()
|
||||
{
|
||||
return basickBlocks;
|
||||
}
|
||||
vector<Region*> getPrevRegions()
|
||||
|
||||
void addBasickBlocks(Region* region)
|
||||
{
|
||||
basickBlocks.insert(region);
|
||||
}
|
||||
unordered_set<Region*> getPrevRegions()
|
||||
{
|
||||
return prevRegions;
|
||||
}
|
||||
Region* getNextRegion()
|
||||
|
||||
unordered_set<Region*> getNextRegions()
|
||||
{
|
||||
return nextRegion;
|
||||
return nextRegions;
|
||||
}
|
||||
void setPrevRegion(Region* region)
|
||||
|
||||
void addPrevRegion(Region* region)
|
||||
{
|
||||
prevRegions.push_back(region);
|
||||
prevRegions.insert(region);
|
||||
}
|
||||
void setNextRegion(Region* region)
|
||||
|
||||
void addNextRegion(Region* region)
|
||||
{
|
||||
nextRegion = region;
|
||||
nextRegions.insert(region);
|
||||
}
|
||||
|
||||
void replaceInPrevRegions(Region* source, Region* destination)
|
||||
{
|
||||
prevRegions.erase(destination);
|
||||
prevRegions.insert(source);
|
||||
}
|
||||
|
||||
void replaceInNextRegions(Region* source, Region* destination)
|
||||
{
|
||||
nextRegions.erase(destination);
|
||||
nextRegions.insert(source);
|
||||
}
|
||||
|
||||
unordered_set<Region*> getSubRegions()
|
||||
{
|
||||
return subRegions;
|
||||
}
|
||||
|
||||
void addSubRegions(Region* region)
|
||||
{
|
||||
subRegions.insert(region);
|
||||
}
|
||||
|
||||
ArrayAccessingIndexes array_def, array_use, array_out, array_in;
|
||||
|
||||
|
||||
private:
|
||||
set<Region*> subRegions, basickBlocks;
|
||||
Region* header;
|
||||
Region* nextRegion;
|
||||
vector<Region*> prevRegions;
|
||||
unordered_set<Region*> subRegions, basickBlocks;
|
||||
/*next Region which is BB for current BB Region*/
|
||||
unordered_set<Region*> nextRegions;
|
||||
/*prev Regions which is BBs for current BB Region*/
|
||||
unordered_set<Region*> prevRegions;
|
||||
Region* header;
|
||||
};
|
||||
|
||||
|
||||
void Collapse(Region* region);
|
||||
void FindPrivateArrays(map<string, vector<LoopGraph*>>& loopGraph, map<FuncInfo*, vector<SAPFOR::BasicBlock*>>& FullIR);
|
||||
void GetDimensionInfo(LoopGraph* loop, map<DIST::Array*, vector<vector<ArrayDimension>>>& loopDimensionsInfo, int level);
|
||||
set<SAPFOR::BasicBlock> GetBasicBlocksForLoop(LoopGraph* loop, vector<SAPFOR::BasicBlock>);
|
||||
pair<SAPFOR::BasicBlock*, unordered_set<SAPFOR::BasicBlock*>> GetBasicBlocksForLoop(LoopGraph* loop, vector<SAPFOR::BasicBlock*> blocks);
|
||||
|
||||
Reference in New Issue
Block a user