lua-users home
lua-l archive

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


Adam Strzelecki wrote:
> > Yes, this is a bug. And I've found the cause for this: setting up
> > synced PHI stack slots can go wrong. Alas, there's no easy fix in
> > sight. This will take me quite a bit of time to solve.
> 
> I tried to look up what is "PHI stack", couldn't find any
> reference, neither sensible expansion for this (I suppose)
> acronym. No surprise though. LuaJIT is pioneer technology. 

No, I'm referring to the stack slots of a PHI variable
(loop-carried variable). Stack slots get assigned, if there are
not enough registers available. And some things can go wrong when
syncing the pre-loop and in-loop stack slots and there are
dependencies between different PHIs.

I guess I'll need to add stack slot RENAMEs to handle that. Which
would drive up complexity. Sadly, even though this case is very
rare, the compiler can't just bail out. That would mean those kind
of loops would never get compiled and performance would suck.

> > BTW: I've got an unresolved bug on ARM, which probably has the
> > same cause. Now I've got a simple test case. Thanks!
> 
> Does this bug only appear in certain situations, like too many
> function arguments? Or it is kind of random problem?

For the general situation, see above. ARM runs out of registers
much sooner, because it's currently a soft-float target. FP values
are held in integer register pairs and ARM has only 6 of these
pairs available.

--Mike