Leo~

On Tue, 23 Nov 2004 23:26:39 +0100, Leopold Toetsch <[EMAIL PROTECTED]> wrote:
> Matt Fowles wrote:
> 
> > Have we seen that this actually destroys us?  Meaning, if we add the
> > extra CFG arcs, do we start spilling like mad?  If not, this is much
> > ado about nothing.
> 
> Please first have a look at Dan's recent posting about Evil Sub. Then
> estimate, how many subs may be called in 14000 basic blocks. For 100
> subs only you get ~10000 more edges ...
> 
> Second, having this arcs means just that in that range i.e. from the
> first subroutine to the last, you can't reuse a register around a call.
> Question: how many from ~23000 registers might be effected. Please note
> the currently rather low spill count despite the huge register usage.

Won't your approach put every one of those things in its own register?
 
> > I proposed an alternate scheme that has minimal impact on existing
> > code.
> 
> C source code or bytecode? The latter isn't effected at all in my scheme
>   if you just swap the two register ranges (I don't care currently). The
> impact on C source changes would be low, even JIT works with just
> s/ctx\.bp/ctp/g

I meant it at the C level.  This feels to me like a fairly major
internal change.  Thus, I am a little surprised that the impact would
be as low as you claim.  But you are definitely the authority on that.


> > ... Right now we guarantee that return continuations restore all
> > non-volatile registers.  If we extend that guarantee to all
> > continuations, everything would just work with the caveat that changes
> > to value registers (as opposed to reference registers) are lost.  This
> > is not a real loss though because refetch all lexicals already
> > requires backing store for I and N registers.
> 
> You are missing the point. It's not a question of preserving, it's
> register re-using. And forcing all I and N registers into lexical PMCs
> totally defeats the optimized usage of these registers.

I don't think that I am.  I understand that the question is one of
reuse.  However, if a continuation restores registers to the data they
had when the continuation was taken, then all of the registers will
contain the things that exactly as the original allocator expects
them.  Code later on can overwrite those registers safe in the
knowledge that any continuation which would jump back to the original
point would also set up its own registers.  Thus, there is no need for
adding backward branches to the CFG.  Also, you do not force all I,N
registers into lexical PMCs.  You only force those ones that need
changes across re-invocations of a continuation to persistent to
persist.  I would expect that such usages are extremely infrequent and
would not occur in finely tuned code.  The majority of uses for I,N
registers will be optimizations on number crunching, such algorithms
will likely not use continuations.  In fact, such algorithms are
usually not stateful at all, and thus would be completely unaffected.

Matt
-- 
"Computer Science is merely the post-Turing Decline of Formal Systems Theory."
-???

Reply via email to