This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] Removal of gotos from cfg based ir


On Fri, 14 Nov 2003 law@redhat.com wrote:
>  >> > > how do you get the edges in the cfg then?
>  >> > Def-use edges, which are tracked for all SSA values.
>  >> how do you then do things like jump threading?
>  >What information, specifically, does jump threading need about the CFG?
> Typically just preds & succs :-)

Ah well, then we use something like this (or s/pred_/succ_/):

for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI)
  BasicBlock *Pred = *PI;

:)

For predecessors, this is implemented by walking the SSA use/def chains on
the basic block themselves.  For successors, this is implemented by
"asking" the terminator at the end of the basic block what it's successors
are.

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]