next up previous contents
Next: Bidirectional edge optimization Up: Meta-Optimizations for XGRS code Previous: Meta-Optimizations for XGRS code

   
Bitset optimization

A rule is bitset optimizable, if all incoming edges to the target node of an assigned edge are implemented by bitsets. If so, for the rule bitset operations are generated; otherwise normal object-based code generation is used.

The following rule is bitset optimizable, if we suppose that EC_DSAVE_OUT, EC_DSAVE_IN, and EC_TRANSP are implemented as SETF(Stmt). The rule test graphs is a directed acyclic graphs, all assigned edges are added in forward direction, and all edges incoming to the target node of the assigned edge s are have bitset functors..


\begin{examplefoot}EC_DSAFE_IN(Block,Expr) :- EC_TRANSP(Block,Expr), EC_DSAFE_OUT(Block,Expr);
\end{examplefoot}

The generated code is


\begin{verblines}for (_onceindex = 1; _onceindex > 0; _onceindex--)
{
/* path t...
... [Block]-EC_TRANSP->[Expr] */
} /* end of rule fake for-loop */
\end{verblines}



Uwe Assmann
1998-12-22