emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#9542: closed (peval inlines recursive procedures)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#9542: closed (peval inlines recursive procedures)
Date: Sun, 18 Sep 2011 21:11:01 +0000

Your message dated Sun, 18 Sep 2011 23:05:55 +0200
with message-id <address@hidden>
and subject line Re: peval error
has caused the debbugs.gnu.org bug report #9542,
regarding peval inlines recursive procedures
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
9542: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9542
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Re: peval error Date: Sun, 18 Sep 2011 12:00:30 +0200 User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)
Hi Andy,

Andy Wingo <address@hidden> skribis:

> Still, though, the results are not great:

[...]

> Here we see that `fold' was inlined once, but to no use.  More code for
> no more speed.

Yes.  OTOH, it was inlined *and* specialized; peval only “inlines”
where’s there’s at least one static argument (known at compile-time), in
which case there’s room for specialization (in this example, *, 1,
zero?, and the anonymous lambdas were propagated/resolved as
primitives.)

In the above example, I agree that we can argue that inlining wasn’t
useful.

> Waddell and Dybvig report on similar problems in their inlining paper
> (Fast and Effective Procedure Inlining, IU CS Dept. TR 484).  See
> section 4.4 where they discuss this and similar problems.  We should
> figure out what we can do in these cases; and in the case where we can't
> fully inline a call site, perhaps we should abort the attempt to inline
> it.

Right.  I think we should avoid inlining when recursive calls appear in
the residual code, as mentioned in the referred section.

WDYT?

Now, the current heuristic in peval is to “inline” procedures only at
call sites with static arguments.  Conversely, a general procedure
inlining algorithm like Waddell’s may inline even when there are only
dynamic arguments.  This puts more pressure on the inlining criteria
because there are many more potential inlining opportunities.

I don’t think an optimization heuristic can be optimal in all cases.

So the question is not whether we can find such pathological cases, but
how frequent they are in practice.  So I think we must keep an eye on
the optimized code, like you did, to find out more.

Thanks for your feedback!

Ludo’.



--- End Message ---
--- Begin Message --- Subject: Re: peval error Date: Sun, 18 Sep 2011 23:05:55 +0200 User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)
Hi,

Andy Wingo <address@hidden> skribis:

> Here we see that `fold' was inlined once, but to no use.  More code for
> no more speed.
>
> Waddell and Dybvig report on similar problems in their inlining paper
> (Fast and Effective Procedure Inlining, IU CS Dept. TR 484).  See
> section 4.4 where they discuss this and similar problems.  We should
> figure out what we can do in these cases; and in the case where we can't
> fully inline a call site, perhaps we should abort the attempt to inline
> it.

Fixed in 72b2ca55f6e115927aa4e76401c992f21198681f.

Thanks!

Ludo’.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]