From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 7572BC75CCE; Thu, 15 Aug 2024 15:51:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7572BC75CCE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1723726265; bh=h9O5Rb4Swvd9HLZcadovfUYMnLf401TjmoGKMczREbw=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=j9NxNH7ApSw+UY69YS59EZtBWBqyFICxYwJNQ1gnTyUNlP7T0J8qbADjuCIao9CMa xm2oKwr+GP3HHmLtZZsPKYkbL/r/0QqHiv+1OaLGaqmEl61JUs/vwTEVCCY8L/ju1y Xp/5VCmvC56vIlcyT2MYzvVxVf5Av7/DDjKCVG3A= Received: from smtp29.i.mail.ru (smtp29.i.mail.ru [95.163.41.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 0149DC75CE2 for ; Thu, 15 Aug 2024 15:51:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0149DC75CE2 Received: by smtp29.i.mail.ru with esmtpa (envelope-from ) id 1seZwU-000000010H4-3UfS; Thu, 15 Aug 2024 15:51:03 +0300 Content-Type: multipart/alternative; boundary="------------v8VP0iN11G1txMiPMojmurF6" Message-ID: Date: Thu, 15 Aug 2024 15:51:02 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun , Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org References: <43b0a69113d3f42a49fa42fea34516561f5ca8a7.1723638851.git.skaplun@tarantool.org> In-Reply-To: <43b0a69113d3f42a49fa42fea34516561f5ca8a7.1723638851.git.skaplun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD9F97E3C14763C38E2F8667C40DD8CE92DDCF89D65A2CC9925182A05F53808504018E34963708DCA009487ABAC94A94B54B74478975B7D978779C1F1751ECA059DB6BD4AB1FA1FD6A3 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A3DED2DACB82E709C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7B9EA053ECF1425EFEA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38B043BF0FB74779F36FF08B26E13CAB7B66B33DE67A4F730208B4B58562BE3CA43A471835C12D1D9774AD6D5ED66289B5259CC434672EE6371117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE77A825AB47F0FC8649FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE72B056A9979167638D32BA5DBAC0009BE395957E7521B51C2330BD67F2E7D9AF1090A508E0FED6299176DF2183F8FC7C08790B6C3D1E27380CD04E86FAF290E2DB606B96278B59C421DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6A8DADCFA31BDB70175ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A575666F0627410D965002B1117B3ED6960D7A9B1FB2F9971F1E49B01306B5E3AD823CB91A9FED034534781492E4B8EEADADEF88395FA75C5FBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF7BFC827FEEA5C357D01457FABAB7B1F3029A454762FE715DFEC381393A87E143141C0AB2DA7D0DDA470327EB0AC8E69317E97F6ADE54463618824FACE497B6B33C1AB686CFED6A705F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojD5rM0r3KxnFti7FCRb6Gfg== X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D6140CA1BA79267B9967348675FF74E8DE1CFF8631119D5F2695E0152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 02/36] test: enable LuaJIT test X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------v8VP0iN11G1txMiPMojmurF6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey Thanks for the patch! See my comments below. On 14.08.2024 16:55, Sergey Kaplun wrote: > This patch moves the test from the to the > created directory, includes it in , and names subtests. > > Testing optimizations in requires CSE, DCE, FOLD, and FWD > optimizations enabled. Hence, the corresponding flags are used for the > directory in . It is still unclear for me *why* a reason of this change. Also patch contains formatting changes, I would say about it in commit message as we usually do it. > > Part of tarantool/tarantool#9398 > --- > test/LuaJIT-tests/opt/index | 1 + > .../{misc => opt/mem}/alias_alloc.lua | 30 +++++++++---------- > test/LuaJIT-tests/opt/mem/index | 1 + > 3 files changed, 16 insertions(+), 16 deletions(-) > rename test/LuaJIT-tests/{misc => opt/mem}/alias_alloc.lua (53%) > create mode 100644 test/LuaJIT-tests/opt/mem/index > > diff --git a/test/LuaJIT-tests/opt/index b/test/LuaJIT-tests/opt/index > index 94d50aec..8c43b56e 100644 > --- a/test/LuaJIT-tests/opt/index > +++ b/test/LuaJIT-tests/opt/index > @@ -3,4 +3,5 @@ fold +fold > fwd +fwd > fuse.lua +fuse > loop +loop > +mem +cse +dse +fold +fwd > sink +sink > diff --git a/test/LuaJIT-tests/misc/alias_alloc.lua b/test/LuaJIT-tests/opt/mem/alias_alloc.lua > similarity index 53% > rename from test/LuaJIT-tests/misc/alias_alloc.lua > rename to test/LuaJIT-tests/opt/mem/alias_alloc.lua > index 02fe618d..a9627b55 100644 > --- a/test/LuaJIT-tests/misc/alias_alloc.lua > +++ b/test/LuaJIT-tests/opt/mem/alias_alloc.lua > @@ -1,8 +1,7 @@ > - > -do > +do --- ALOAD forwarding, same table. > local t = {1} > local x > - for i=1,100 do > + for i = 1, 100 do > local v = {i} > t[1] = v[1] > x = v[1] > @@ -10,45 +9,44 @@ do > assert(x == 100 and t[1] == 100) > end > > -do > +do --- ALOAD forwarding, different tables. > local t = {1} > local x,y > - for i=1,100 do > + for i = 1, 100 do > local v = {i} > - local w = {i+1} > + local w = {i + 1} > x = v[1] > y = w[1] > end > assert(x == 100 and y == 101) > end > > -do > +do --- FLOAD forwarding. > local mt = {} > local t = setmetatable({}, mt) > local x > - for i=1,100 do > + for _ = 1, 100 do > local v = {} > setmetatable(v, getmetatable(t)) > assert(getmetatable(v) == mt) > end > end > > --- See also sink_alloc.lua > -do > - local x,k={1,2},{3,4} > - for i=1,100 do x = {x[1]+k[1], x[2]+k[2]} end > +-- See also . > +do --- Forwarding the constant-on-trace table in the complex add. > + local x, k = {1, 2}, {3, 4} > + for _ = 1, 100 do x = {x[1] + k[1], x[2] + k[2]} end > assert(x[1] == 301) > assert(x[2] == 402) > end > > --- FLOAD for tab.asize/tab.array crossing NEWREF. > -do > + > +do --- FLOAD forwarding for tab.asize/tab.array crossing NEWREF. > local t = {1} > - for i=1,100 do > + for _ = 1, 100 do > local v = {} > local w = {} > v[1] = t[1] > w[1] = t[1] > end > end > - > diff --git a/test/LuaJIT-tests/opt/mem/index b/test/LuaJIT-tests/opt/mem/index > new file mode 100644 > index 00000000..0b1856ed > --- /dev/null > +++ b/test/LuaJIT-tests/opt/mem/index > @@ -0,0 +1 @@ > +alias_alloc.lua --------------v8VP0iN11G1txMiPMojmurF6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey

Thanks for the patch! See my comments below.

On 14.08.2024 16:55, Sergey Kaplun wrote:
This patch moves the <alias_alloc.lua> test from the <misc> to the
created <opt/mem> directory, includes it in <index>, and names subtests.

Testing optimizations in <lj_opt_mem.c> requires CSE, DCE, FOLD, and FWD
optimizations enabled. Hence, the corresponding flags are used for the
<mem> directory in <index>.

It is still unclear for me *why* a reason of this change.

Also patch contains formatting changes, I would say about it in commit message

as we usually do it.


Part of tarantool/tarantool#9398
---
 test/LuaJIT-tests/opt/index                   |  1 +
 .../{misc => opt/mem}/alias_alloc.lua         | 30 +++++++++----------
 test/LuaJIT-tests/opt/mem/index               |  1 +
 3 files changed, 16 insertions(+), 16 deletions(-)
 rename test/LuaJIT-tests/{misc => opt/mem}/alias_alloc.lua (53%)
 create mode 100644 test/LuaJIT-tests/opt/mem/index

diff --git a/test/LuaJIT-tests/opt/index b/test/LuaJIT-tests/opt/index
index 94d50aec..8c43b56e 100644
--- a/test/LuaJIT-tests/opt/index
+++ b/test/LuaJIT-tests/opt/index
@@ -3,4 +3,5 @@ fold +fold
 fwd +fwd
 fuse.lua +fuse
 loop +loop
+mem +cse +dse +fold +fwd
 sink +sink
diff --git a/test/LuaJIT-tests/misc/alias_alloc.lua b/test/LuaJIT-tests/opt/mem/alias_alloc.lua
similarity index 53%
rename from test/LuaJIT-tests/misc/alias_alloc.lua
rename to test/LuaJIT-tests/opt/mem/alias_alloc.lua
index 02fe618d..a9627b55 100644
--- a/test/LuaJIT-tests/misc/alias_alloc.lua
+++ b/test/LuaJIT-tests/opt/mem/alias_alloc.lua
@@ -1,8 +1,7 @@
-
-do
+do --- ALOAD forwarding, same table.
   local t = {1}
   local x
-  for i=1,100 do
+  for i = 1, 100 do
     local v = {i}
     t[1] = v[1]
     x = v[1]
@@ -10,45 +9,44 @@ do
   assert(x == 100 and t[1] == 100)
 end
 
-do
+do --- ALOAD forwarding, different tables.
   local t = {1}
   local x,y
-  for i=1,100 do
+  for i = 1, 100 do
     local v = {i}
-    local w = {i+1}
+    local w = {i + 1}
     x = v[1]
     y = w[1]
   end
   assert(x == 100 and y == 101)
 end
 
-do
+do --- FLOAD forwarding.
   local mt = {}
   local t = setmetatable({}, mt)
   local x
-  for i=1,100 do
+  for _ = 1, 100 do
     local v = {}
     setmetatable(v, getmetatable(t))
     assert(getmetatable(v) == mt)
   end
 end
 
--- See also sink_alloc.lua
-do
-  local x,k={1,2},{3,4}
-  for i=1,100 do x = {x[1]+k[1], x[2]+k[2]} end
+-- See also <opt/sink/alloc.lua>.
+do --- Forwarding the constant-on-trace table in the complex add.
+  local x, k = {1, 2}, {3, 4}
+  for _ = 1, 100 do x = {x[1] + k[1], x[2] + k[2]} end
   assert(x[1] == 301)
   assert(x[2] == 402)
 end
 
--- FLOAD for tab.asize/tab.array crossing NEWREF.
-do
+
+do --- FLOAD forwarding for tab.asize/tab.array crossing NEWREF.
   local t = {1}
-  for i=1,100 do
+  for _ = 1, 100 do
     local v = {}
     local w = {}
     v[1] = t[1]
     w[1] = t[1]
   end
 end
-
diff --git a/test/LuaJIT-tests/opt/mem/index b/test/LuaJIT-tests/opt/mem/index
new file mode 100644
index 00000000..0b1856ed
--- /dev/null
+++ b/test/LuaJIT-tests/opt/mem/index
@@ -0,0 +1 @@
+alias_alloc.lua
--------------v8VP0iN11G1txMiPMojmurF6--