caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Florian Hars <hars@bik-gmbh.de>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] paralell assignment problem
Date: 09 Feb 2005 04:38:38 +1100	[thread overview]
Message-ID: <1107884318.5022.195.camel@pelican.wigram> (raw)
In-Reply-To: <4208E2D3.3090700@bik-gmbh.de>

On Wed, 2005-02-09 at 03:03, Florian Hars wrote:
> skaller wrote:
> > Does anyone know how to solve the parallel assignment problem
>  > I seek a solution which minimises the number of assignments.
> 
> What, in polynomial time?

Actually total exhaustion may be quite feasible for
small numbers of assignments which is typical for many
tight loops presented as tail-recursive self calls.

In this case 'perfection' is desirable, whereas if 
there are 20 arguments, 'good enough' is probably good enough..

> But the comp.compilers link seems relevant and points further to
> 
> [3] Robert G Burger, Oscar Waddell, and R. Kent Dybvig.
>            Register allocation using lazy saves, eager restores,
>            and greedy shuffling. In 1995 ACM Conference on Programming
>            Language Design and Implementation, June 1995, pages 130-138.
>            Available online via
> ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/pubs/Reg-Alloc-PLDI95.ps.gz
> 
> which claims NP-completeness for the problem.

Ah, section 2.3 suggests 'Greedy Shuffling' is useful.
At present my algorithm is picking an arbitrary assignment,
but this paper suggests picking the which is depended
on most. They claim in only one program, their compiler,
did this yield non-optimal results, and in the compiler
only in 6 of 20,245 cases, in all of which only one
additional temporary was allocated.

So, thanks, this seems to be enough to finish of the
algorithm with some confidence the results will be good!


-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net




  reply	other threads:[~2005-02-08 17:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-08  3:07 skaller
2005-02-08 14:34 ` Stefan Monnier
2005-02-08 16:02   ` [Caml-list] " skaller
2005-02-08 18:20     ` Stefan Monnier
2005-02-08 17:08   ` skaller
2005-02-08 18:33     ` Radu Grigore
2005-02-09  7:48       ` Radu Grigore
2005-02-09 10:11         ` skaller
2005-02-09  9:43       ` Radu Grigore
2005-02-09 11:19         ` Radu Grigore
2005-02-09 11:34         ` Pascal Zimmer
2005-02-09 13:53           ` skaller
2005-02-08 16:03 ` [Caml-list] " Florian Hars
2005-02-08 17:38   ` skaller [this message]
2005-02-08 16:29 ` Marcin 'Qrczak' Kowalczyk
2005-02-08 17:55   ` skaller
2005-02-08 18:32     ` Marcin 'Qrczak' Kowalczyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1107884318.5022.195.camel@pelican.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@inria.fr \
    --cc=hars@bik-gmbh.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).