On Tuesday 26 August 2008 06:13:07 [EMAIL PROTECTED] wrote: > --- trunk/compilers/pirc/new/pircompunit.c (original) > +++ trunk/compilers/pirc/new/pircompunit.c Tue Aug 26 06:13:06 2008 > @@ -24,6 +24,29 @@ > of the parsed PIR code. Through the symbol management, which is done > in F<pirsymbol.c>, a vanilla register allocator is implemented. > > + > +=head1 OPTIMIZATION > + > +Although at this point not as important as bytecode generation, > +PIRC might need an optimizing register allocator. For this to work, > +the following is needed: > + > +=over 4 > + > +=item * an easy way to decide whether an instruction can jump; in that > +case this instruction marks the end of a C<basic block>. Such > +instructions are: C<invokecc>, C<branch>, C<get_results> etc. > +Labeled instructions must also be marked as such, as they can be jumped > +to, and indicate the start of a C<basic block>. Can this flow > +information be retrieved through a Parrot function?
IMCC uses the ITBRANCH flag (set on ins->type). See compilers/imcc/parser_util.c:600 - 700. Most of this information comes from the interp->op_info_table array, indexed by the op number. -- c