-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid HSTORE elimination over nkeys and clone #147
Comments
@XmiliaH Thanks for the report! We'll look into this. It seems like the optimizer needs to be aware of the nkeys IR. |
I think the problem is in @@ -369,7 +369,9 @@ TRef LJ_FASTCALL lj_opt_dse_ahstore(jit_State *J)
** since they are followed by at least one guarded VLOAD.
*/
for (ir = IR(J->cur.nins-1); ir > store; ir--)
- if (irt_isguard(ir->t) || ir->o == IR_ALEN)
+ if (irt_isguard(ir->t) || ir->o == IR_ALEN ||
+ (ir->o == IR_CALLL && ir->op2 == IRCALL_lj_tab_nkeys) ||
+ (ir->o == IR_CALLS && ir->op2 == IRCALL_lj_tab_clone))
goto doemit; /* No elimination possible. */
/* Remove redundant store from chain and replace with NOP. */
*refp = store->prev; |
@XmiliaH would you please create a PR for this issue? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is possible that a
HSTORE
before a call totable.nkeys
ortable.clone
is eliminated by aHSTORE
after said functions resulting in wrong results.This is demonstrated by the following example which should print
0 nil
but the actual output is1 99999
.The text was updated successfully, but these errors were encountered: