Re: Docs for allocation sinking optimization

  • From: Geoff Leyland <geoff_leyland@xxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 12 Jul 2012 10:53:12 +1200

On 12/07/2012, at 3:59 AM, Mike Pall wrote:

> More than you ever wanted to know on how allocation sinking and
> store sinking actually works can be found here:


Thanks!

Does allocation sinking put pressure on stack slots?  It seems like value 
stored in an allocation has to be live for the whole trace.  Take this (stupid) 
example:

do
  local x, z = 0, nil
  for i=1,100 do
    local t = {i, i+1, i+2, i+3, i+4, i+5}
    if i == 90 then
      z = t
    end 
    x = x + t[1]
  end
  print(x, z[1])
end

It looks like t[2..5] are occupying stack slots.  I can see that it's hard to 
work out that they're dead.

Cheers,
Geoff


Other related posts: