[LLVMdev] Seeking advice on Structural Analysis pass

James Stanier j.stanier at sussex.ac.uk
Sat Mar 13 11:54:03 PST 2010


Hi folks,

A few months back I finished writing and testing a pass which implements
"structural analysis" as described originally by Sharir in 1980 ("Structural
analysis: A new approach to flow analysis in optimizing compilers") and more
recently by Muchnick in Advanced Compiler Design and Implementation. It
analyses the CFG and recognises specific region schema, such as if-then,
if-then-else, while-loop, etc., and builds a "control tree" which represents
the hierarchical structure of the input program.

Somebody asked about this pass a couple of years ago:
http://old.nabble.com/Structural-Analysis-to9429397.html#a9429397

I wrote this to get results for a paper, and it needs some tidying up, but
it's been tested on 10,000-15,000 functions from open source programs and it
works fine, albeit rather slow on big programs because of the exceptionally
slow (and exceptionally lazy...) way I implemented calculating dominators,
but this could be fixed in the future.

Would this be a welcome addition to the project? The only reason that I ask
is that it doesn't actually perform any optimisations, it just builds the
control tree. Also, this was the first non-trivial piece of C++ code I ever
wrote, and I think my code absolutely stinks in places. But it works, and it
might be of use to somebody.

What do you think?

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




More information about the llvm-dev mailing list