[LLVMdev] Make LoopBase inherit from "RegionBase"?
etherzhhb at gmail.com
Fri Jan 8 05:20:24 PST 2010
sorry that i forgot to change the subjuect
On 2010-1-7 0:11, John Mosby wrote:
> In LLVM we could add support for generalized CFG regions and
> RegionPasses. A region is a part of the CFG. The only information we
> have is, that it has one entry and one exit, this it can be optimized
> I think this is the best way to add region analysis. I must admit this
> helps me on another, similar project I'm working on in parallel (no
> pun intended).
> Tobias, is this how you are architecting your region analysis already?
i just implementing the skeleton of Region/RegionInfo like LoopBase and
LoopInfoBase in the llvm existing codes, and found that theres lots
of common between "Region" and "Loop":
1. both of them are consist of several BasicBlocks
2. both of them have some kind of nested structures, so both a loop and
a region could have parent or childrens
3. both of them have a BasicBlocks(header of a loop and "entry" of a
region) that dominates all others
and the Region class will have the most stuffs very similar in LoopBase,
like: ParentRegion, SubRegions, Blocks, getRegionDepth(),
getExitBlock(), getExitingBlock() ......
so, could us just treat "Loop" as some kind of general "Region" of
BasicBlocks, and make Loop and Region inherit from "RegionBase"?
More information about the llvm-dev