lua-users home
lua-l archive

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

Vyacheslav Egorov wrote:
> Mike Pall mentioned that some algorithms used in Lua JIT 2 exploit
> _absence_ of goto in Lua.
> So I assume that LJ2 would not perform well for arbitrary irreducible
> cfgs. But I am not sure, it is for Mike to clarify.

Yes, the NLF (natural-loop-first) region-selection algorithm
relies on having only 'natural' loops, as the name implies.

Irreducible cfgs are the exception, so one could certainly extend
the algorithm to cope with it somehow. But it's probably not that
simple and it might select suboptimal regions for these cfgs.

The other issue is that all JMPs in LJ2's bytecode also indicate
the top of the set of live registers. That's easy to generate from
the parser on-the-fly. Recreating this information from arbitrary
cfgs requires data-flow analysis (standard textbook algorithm, but
hard to get right).