[llvm-commits] [LLVMdev] DominanceFrontier for MachineBB

Tobias Grosser grosser at fim.uni-passau.de
Tue Jul 27 09:42:25 PDT 2010


On 07/27/10 18:04, Chris Lattner wrote:
> 
> On Jul 27, 2010, at 8:16 AM, ether zhhb wrote:
> 
>>> ether did once a templated version and I would love to test and commit
>>> it. I just wanted to import an untemplated version of the RegionInfo
>>> pass first, as it was easier to review.
>>>
>>> @ether. Do you think you could port your templated version of the
>>> RegionInfo pass to trunk?
>> RegionInfo need PostDominatorTree and DominanceFrontier, do us have
>> DominanceFrontier for MachineBB?
> 
> What does RegionInfo use DomFrontier for?  I had hoped that we would eventually eliminate it.  It's currently only being used for a couple things (like mem2reg) and is extremely expensive to compute (besides the implementation being terrible, it's an inherently N^2 data structure).

It is currently used to check if two BasicBlocks form a region. The two
calls to DominanceFrontier are in RegionInfo::isRegion(). I do not know
of an easy way to remove the usage of this analysis, however I have to
admit that I did not spend too much time on trying this.
I know the complexity is N^2, however my tests showed that at least for
the spec 2006 and polyhedron fortran benchmarks dominance frontier was
pretty fast to calculate. Actually it was faster than all other analysis:

http://tobias.osaft.eu/regioninfo/sum_runtime.png (relative timings)

I did not spend a lot of time to optimize this. Do you know of any non
artificial test case (or even an artificial one), where dominance
frontier calculation is slowing down compilation? In case there is a
chance to improve performance of regioninfo or dominance frontier
calculation I would love to do this.

Cheers
Tobi




More information about the llvm-commits mailing list