From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Maxim Kokryashkin <m.kokryashkin@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH luajit 2/2] Fix canonicalization of +-0.0 keys for IR_NEWREF. Date: Sat, 20 May 2023 18:03:34 +0300 [thread overview] Message-ID: <ZGjhRkFJRA4xTqTh@root> (raw) In-Reply-To: <1684152313.987316030@f170.i.mail.ru> Hi, Maxim! Thanks for the review! Fixed your comments and force-pushed the branch. On 15.05.23, Maxim Kokryashkin wrote: > > Hi, Sergey! > Thanks for the patch! > LGTM, except for a few nits regarding the commit message. > > > > >>From: Mike Pall <mike> > >> > >>Reported by Sergey Kaplun. > >> > >>(cherry picked from commit 96fc114a7a3be3fd2c227d5a0ac53aa50cfb85d1) > >> > >>This commit is a follow-up for the commit > >>f067cf638cf8987ab3b6db372d609a5982e458b5 ("Fix narrowing of unary > >>minus."). Since this commit -0 IR constant is stored as well as +0 > >Typo: s/as well as/as well as the/ Fixed. > >>constant on the trace. Since IR NEWREF keys don't canonicalizied for -0 > >Typo: s/don’t canonicalized/don’t get canonicalized/ Changed to "aren't canonicalizied", thanks! > >>opposed of IR HREFK, it may lead to inconsistencies during trace > >Typo: s/opposed of/as opposed to/ Fixed! Thanks! > >>recording. > >> > >>In particular, since -0 and 0 are different IR constants, alias analysis > >>declares that they can't be aliased during folding optimization. > >>Therefore: > >>1) For the IR TNEW we have non-nil value to lookup from the table via > >> HLOAD, when only nil lookup is expected due to alias analysis. > >>2) For the IR TDUP we have non-nil value to lookup from the table via > >> HLOAD, but the template table has no 0 field initiated as far as -0 > >> isn't folding to 0 during parsing (see `bcemit_unop()` in > >> <src/lj_parse.c>). > >>These cases lead to the assertion failures in `fwd_ahload()`. > >Typo: s/the assertion/assertion/ Fixed! > >> > >>This patch adds the aforementioned canonicalization. > >> > >>Sergey Bronnikov: > >>* reported the original issue for the TDUP IR > >> > >>Sergey Kaplun: > >>* added the description and the test for the problem > >> > >>Part of tarantool/tarantool#8516 > >>--- > >> > >>Side note: I don't mention the 981 issue by intend -- I don't want to > >>bother Mike with force pushes:). I suppose Igor should add this line (if > >>he wants) went this commit will be cherry-picked to our master branch > >>(a.k.a. tarantool). > >> > >> src/lj_record.c | 2 + > >> .../tarantool-tests/lj-981-folding-0.test.lua | 57 +++++++++++++++++++ > >> 2 files changed, 59 insertions(+) > >> create mode 100644 test/tarantool-tests/lj-981-folding-0.test.lua > >> > >>diff --git a/src/lj_record.c b/src/lj_record.c > >>index 9e2e1d9e..cc44db8d 100644 > >>--- a/src/lj_record.c > >>+++ b/src/lj_record.c <snipped> > >>diff --git a/test/tarantool-tests/lj-981-folding-0.test.lua b/test/tarantool-tests/lj-981-folding-0.test.lua > >>new file mode 100644 > >>index 00000000..251da24d > >>--- /dev/null > >>+++ b/test/tarantool-tests/lj-981-folding-0.test.lua <snipped> > >>2.34.1 > >-- > >Best regards, > >Maxim Kokryashkin -- Best regards, Sergey Kaplun
next prev parent reply other threads:[~2023-05-20 15:07 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-05-10 12:34 [Tarantool-patches] [PATCH luajit 0/2] " Sergey Kaplun via Tarantool-patches 2023-05-10 12:34 ` [Tarantool-patches] [PATCH luajit 1/2] test: add utility for parsing `jit.dump` Sergey Kaplun via Tarantool-patches 2023-05-15 11:11 ` Maxim Kokryashkin via Tarantool-patches 2023-05-15 12:00 ` Maxim Kokryashkin via Tarantool-patches 2023-05-21 7:47 ` Sergey Kaplun via Tarantool-patches 2023-05-21 7:39 ` Sergey Kaplun via Tarantool-patches 2023-05-22 7:04 ` Sergey Kaplun via Tarantool-patches 2023-05-29 13:55 ` Maxim Kokryashkin via Tarantool-patches 2023-05-16 10:55 ` Sergey Bronnikov via Tarantool-patches 2023-05-22 7:02 ` Sergey Kaplun via Tarantool-patches 2023-05-22 9:14 ` Sergey Kaplun via Tarantool-patches 2023-05-10 12:34 ` [Tarantool-patches] [PATCH luajit 2/2] Fix canonicalization of +-0.0 keys for IR_NEWREF Sergey Kaplun via Tarantool-patches 2023-05-15 12:05 ` Maxim Kokryashkin via Tarantool-patches 2023-05-20 15:03 ` Sergey Kaplun via Tarantool-patches [this message] 2023-05-16 12:17 ` Sergey Bronnikov via Tarantool-patches 2023-05-20 14:54 ` Sergey Kaplun via Tarantool-patches 2023-05-22 7:55 ` Sergey Bronnikov via Tarantool-patches 2023-06-27 13:28 ` [Tarantool-patches] [PATCH luajit 1/3] test: split utils.lua into several modules Igor Munkin via Tarantool-patches 2023-06-27 13:35 ` Igor Munkin via Tarantool-patches 2023-06-28 11:36 ` Sergey Kaplun via Tarantool-patches 2023-06-28 16:07 ` Igor Munkin via Tarantool-patches 2023-07-04 17:10 ` [Tarantool-patches] [PATCH luajit 0/2] Fix canonicalization of +-0.0 keys for IR_NEWREF Igor Munkin via Tarantool-patches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=ZGjhRkFJRA4xTqTh@root \ --to=tarantool-patches@dev.tarantool.org \ --cc=m.kokryashkin@tarantool.org \ --cc=skaplun@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH luajit 2/2] Fix canonicalization of +-0.0 keys for IR_NEWREF.' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox