From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: compile-rtl Date: Sun, 27 Jan 2013 11:28:05 +0100 Message-ID: <87sj5m9ayy.fsf@pobox.com> References: <87mww24f3g.fsf@pobox.com> <5103cae3.886a980a.4bbe.4e2b@mx.google.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1359282500 26430 80.91.229.3 (27 Jan 2013 10:28:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Jan 2013 10:28:20 +0000 (UTC) Cc: guile-devel To: Stefan Israelsson Tampe Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Jan 27 11:28:39 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TzPTW-0000d4-5Y for guile-devel@m.gmane.org; Sun, 27 Jan 2013 11:28:34 +0100 Original-Received: from localhost ([::1]:50177 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TzPTE-0006Hg-CM for guile-devel@m.gmane.org; Sun, 27 Jan 2013 05:28:16 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TzPT8-0006HO-Lt for guile-devel@gnu.org; Sun, 27 Jan 2013 05:28:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TzPT7-00051t-I9 for guile-devel@gnu.org; Sun, 27 Jan 2013 05:28:10 -0500 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:64064 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TzPT7-00051f-CJ for guile-devel@gnu.org; Sun, 27 Jan 2013 05:28:09 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 1C1A7AC5F; Sun, 27 Jan 2013 05:28:09 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=GsLQ9IAO5p8UoABBR6ddkXGiCvI=; b=DiT6NL GSzNYZ4Gm/u/4qc+Yqnetlgp2XA5YMhpjPkFljEO6inN6KDNrHISKbzrtOfpm03j IX30ngPhhRwEGV8tK7Mjo/CzayaYRR2Cv+QXa1BiyJLeYtfzqhTz0BaBoHKPf9de iLv61dDJ6GMqXZOi0DxHjRnUUpcrBym6uImLg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=ktbwmGqe1nyS5lCvxleJZRx3HnHGPRL1 pkhFomm1Bz70XHcpfRj00W0UeZKLUtA/uBYqMjmp4JZrg2vo29QwSgYRJCDoHHOO VtxM8vsREVJKhT2sicVOq4kmqnb5OpY6jnXU6NIaoxI6IaPHGbu53gf9yUFRFXjN rc1YGVpVPWE= Original-Received: from a-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 0C3E5AC5E; Sun, 27 Jan 2013 05:28:09 -0500 (EST) Original-Received: from badger (unknown [88.160.190.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 694BDAC5D; Sun, 27 Jan 2013 05:28:08 -0500 (EST) In-Reply-To: <5103cae3.886a980a.4bbe.4e2b@mx.google.com> (Stefan Israelsson Tampe's message of "Sat, 26 Jan 2013 13:28:37 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-Pobox-Relay-ID: 3E4F38EA-686C-11E2-B672-0A4F0E5B5709-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 208.72.237.25 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15601 Archived-At: On Sat 26 Jan 2013 13:28, Stefan Israelsson Tampe writes: > Andy Wingo writes: > >>> Now when we are tail-calling in rtl, we just fill the argument slots >>> with the new function arguments directly and then tail-call by filling >>> in >>> number of arguments and function. This is very smart and just some >>> simple features added would mean that a lot of translation >>> from one memory location to the other is skipped. I really like how the >>> rtl code handle this but there is an expense. It complicates life a >>> little >>> when we overwrite arguments that are used in the calculation of other >>> arguments. I'm working on how to handle this but I just wanted to point >>> out how nice this design choice is. >> >> Thanks! In general at the end you have a parallel register move (or >> parallel assignment), which has a number of standard solutions out >> there. > > This is quite a natural first step. But especially for loops there is > a similar tail pattern that probably needs to be optimized better w.r.t. > register slots when we compile nativly There are two things that can help here: (1) Tight allocation of registers (VM or native). Registers should be allocated not just in terms of scope but in terms of where they are used -- after their last use they are dead and so the register is available for some other purpose. This can allow the loop variables in a loop can be updated in-place, without shuffling. (2) For the native case, native register allocation. I've worked with linear scan before and it seems pretty good, and we could do it directly on the CPS form; Wimmer et al are able to do it on SSA form, so I don't see why not. Andy -- http://wingolog.org/