This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: [PATCH] further optimization for call-with-values
- From: Per Bothner <per at bothner dot com>
- To: kawa at sourceware dot org
- Date: Thu, 26 Mar 2015 21:40:45 -0700
- Subject: Re: [PATCH] further optimization for call-with-values
- Authentication-results: sourceware.org; auth=none
- References: <83329DDE-2C17-4907-A588-B4587264A889 at theptrgroup dot com>
On 03/25/2015 04:12 PM, Jamison Hope wrote:
The attached patch optimizes the call-with-values case where the
consumer is a single-argument procedure to rewrite
(call-with-values producer consumer) as (consumer (producer)).
Thanks - I checked this in.
It works when the consumer is a LambdaExp and also when it is
a ReferenceExp whose value is (known to be) a Procedure.
You "missed" one case: Where the consumer is a ReferenceExp
that is bound to a LambdaExp - i.e. when the consumer is a named
procedure that hasn't been compiled yet. I tweaked your patch
to handle this.
I also added a test testsuite/values2.scm, and added it
to the check-inlining test to make sure it is optimized and
stays optimized.
--
--Per Bothner
per@bothner.com http://per.bothner.com/