develooper Front page | perl.perl6.internals | Postings from September 2001

Flow graph

From:
Leon Brocard
Date:
September 22, 2001 11:09
Subject:
Flow graph
Message ID:
20010922191010.A32595@ns0.astray.com
So there I was, reading my Dragon book again and thinking about
optimising Parrot bytecode. I took disassemble.pl, hacked it to
actually output source code that might compile, and gave it some
knowledge about operators, basic blocks, and flow graphs. And hooked
it up to Graphviz[1]. The code is real ugly, but the results is cute
so I'll share the picture.

It reads bytecode, this time of Greg's pasm for the Leibniz summation
for PI (see bottom of http://www.parrotcode.org/examples/) and outputs
a flow graph for the program:
http://astray.com/bb.png

Basic blocks are important as you should only do peephole
optimisations within them. Ignore if this is over your head. Enjoy the
pretty picture above and bear in mind that this will eventually turn
into a real bytecode optimiser for Parrot. Maybe.

Leon
 
[1] Inevitable, really
-- 
Leon Brocard.............................http://www.astray.com/
Nanoware...............................http://www.nanoware.org/

... "1001 Things To Do With Whipped Cream", LGLB (1995)



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About