[rfc] preview patch for RBO

Jules Bergmann jules at codesourcery.com
Thu Feb 1 15:22:50 UTC 2007


This preview patch adds support for "return block optimization", for 
example to allow by-value FFTs to be lazily evaluated.

The patch:

  - adds a new expression block called "Return_block" that encapsulates 
an operation in a function object.

  - adds a new evaluator for simple Return_block expressions (such as 'A 
= fft(B)').  The evaluator passes the destination block 'A' to the 
function object.

  - adds init/fini stage to loop fusion evaluation so that complex 
Return_block expressions (such as 'A = fft1(B) + fft2(C)') can be 
evaluated.  Before loop fusion, init is called for each node in the 
expression tree.  This allows Return_blocks to initialize temporary 
storage for its result.  After loop fusion, fini is called so storage 
can be freed.

It is possible that the Fft objects temporary buffers could be used to 
avoid alloc/free of temporary space, but reuse of the same Fft object 
('A = fft(B) + fft(C)') would require special handling.

  - modifies by-value Fft to return a Return_block.

-- 
Jules Bergmann
CodeSourcery
jules at codesourcery.com
(650) 331-3385 x705
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rbo.diff
URL: <http://sourcerytools.com/pipermail/vsipl++/attachments/20070201/70585b11/attachment.ksh>


More information about the vsipl++ mailing list