[LLVMdev] Seeking advice on Structural Analysis pass

James Stanier j.stanier at sussex.ac.uk
Tue Mar 16 09:05:04 PDT 2010


Hi Trevor,

I just studied your diagrams -- I *think* that the "control tree" of
structural analysis is not same as the "control flow tree" from your own
Java work. However, as you understand your work more than I do, I present
you with some fancy coloured diagrams that I drew that might help you (and
others!) understand what structural analysis does a bit better than the
black-and-white ones in Muchnick's book.

This first diagram shows a CFG in step 1, and the steps of reduction that
structural analysis performs:
http://www.informatics.sussex.ac.uk/users/js231/img/sa-example-reduction.pdf

For example, in the first step, the red cloud indicates that the blocks "B6"
and "exit" are matched to the "continuous blocks" schema. These are then
reduced into an abstract node which is called B6a and is coloured red (the
same colour as the cloud) in the next step. Then, block "B5" is matched to
the "self loop" schema, and replaced by the pink abstract node "B5a" in the
next diagram. This continues until there is only one node left, and
structural analysis has finished.

This second diagram shows the control tree that is built while these
reductions are occurring, which shows the hierarchical structure of the
program. The coloured nodes are the abstract nodes from the first diagram,
and all leaf nodes are the original basic blocks.
http://www.informatics.sussex.ac.uk/users/js231/img/sa-example-controltree.pdf

Does this make it any clearer? I'm happy to explain it in more detail.

Best,
James
-- 
View this message in context: http://old.nabble.com/Seeking-advice-on-Structural-Analysis-pass-tp27890316p27920484.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.




More information about the llvm-dev mailing list