[llvm-commits] CVS: llvm/lib/VMCore/Dominators.cpp

Chris Lattner clattner at apple.com
Fri Jun 8 10:39:02 PDT 2007


On Jun 7, 2007, at 11:59 AM, Nick Lewycky wrote:

> Devang Patel wrote:
>> On Jun 7, 2007, at 10:46 AM, Nick Lewycky wrote:
>>> Similarly, I pass ETNodes around to functions that don't care about
>>> which BB is actually involved, but do need the DFS numbers for
>>> whatever reason.
>>
>> In that case what's the use of ETNode ?
>
> The DFS numbers. ETNode is the only way to see what the DFS in and DFS
> out numbers are.
>
> At a conceptual level, those numbers uniquely identify the scope  
> and are
> used in determining which InequalityGraph properties (also stored
> per-ETNode) apply by comparing them for dominance, using the DFS  
> numbers.
>
> Yes we could pass BBs around and modify ETForest to return DFS numbers
> from BBs directly, but it would probably be too slow.

More generally, the df numbers are an internal implementation detail  
of domtree.  If predsimplify needs df numbers, it should just compute  
them itself and store them in a map.  This gives it complete control  
over them and allows you to do whatever you want with them.  Doing a  
DFS is both fast and easy (just use llvm/ADT/DepthFirstIterator.h).

-Chris





More information about the llvm-commits mailing list