[Tarantool-patches] [PATCH luajit] Fix FOLD rule for strength reduction of widening.

Sergey Kaplun skaplun at tarantool.org
Fri Oct 29 10:49:15 MSK 2021


Hi!

On 28.10.21, sergos wrote:
> Hi! 
> 
> The description looks good!
> 
> Although, I can’t get the point how this
> 
> > (negative offset from the stack
> > pointer may appear positive and result is undefined memory access). 
> 
> can’t be applied to a constant? Hence, we’d need a check?
> 
> >> Should it check if integer - even a constant one - is positive? 
> > 
> > No, why? In fold rule are declared both types: INT64 and UINT64.

Sorry, misinterpreted your question here.
Yes, there is the check
| lo && IR(lo)->o == IR_KINT && IR(lo)->i + ofs >= 0
that the result (constant) integer value for this IR is not negative and we don't
lose its sign and can use the cheaper instruction.

> Although, I’m trying to get into Mike’s business again. So it LGTM as a backport.
> 
> Regards,
> Sergos
> 
> 

<snipped>

> > -- 
> > Best regards,
> > Sergey Kaplun
> 

-- 
Best regards,
Sergey Kaplun


More information about the Tarantool-patches mailing list