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 667504F3148; Mon, 3 Jul 2023 22:32:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 667504F3148 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1688412767; bh=L6eU38tATfjhqBpETEjxGy+JwdZaECVZLZEpMG+++1k=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=xw6akMf94/jLCOrZsGgjOtbqnP2I5Yg3Ef+OxCGXsZ3oDx8O5dK0ry4dLIb4Dh/fZ EC8Rbj7zr8bPrETkWYXMXBoXx3QsqGdQ2PwOnSeRbI5FmhEaitcmYDgkLJ/qu3O7vz a0fZn/T+nKqLTHDWfJNsf9gDuFZbAj9oH+oxDgT0= Received: from smtp41.i.mail.ru (smtp41.i.mail.ru [95.163.41.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 46130412EED for ; Mon, 3 Jul 2023 22:32:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 46130412EED Received: by smtp41.i.mail.ru with esmtpa (envelope-from ) id 1qGPHw-00AGaI-6y; Mon, 03 Jul 2023 22:32:44 +0300 Date: Mon, 3 Jul 2023 19:24:01 +0000 To: Sergey Kaplun Message-ID: References: <20230510213002.5153-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230510213002.5153-1-skaplun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9C4EAA31E0E24A8391D423202CFD1382FC96472FA0F0CC72B182A05F5380850401552A731676CD21A04B40300C2E87088DE79CEB53A3DAD06C64C9682F9A603A0 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7B9D6DADD6B53929DEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006370218B86C916BF3528638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8A12CB087AB62A7FAB69DE9A91ADDFF00117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520C24E1E72F37C03A02CC0D3CB04F14752D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE902A1BE408319B296E0066C2D8992A164AD6D5ED66289B52698AB9A7B718F8C46E0066C2D8992A16725E5C173C3A84C392AF71FE74A2456CBA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CFED8438A78DFE0A9E1DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C34B08FA16E56A400835872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A5624FF89BE3119E2855D14E4D48A9CDD71229F4976832CDE6F87CCE6106E1FC07E67D4AC08A07B9B06A1CB4668A9CA5FACB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34AEC7C2AC3C44791DA46623EF06C9A4015665541F3A0F2091DE5E27C1D3C984C066356008A2242C7B1D7E09C32AA3244C85EFEDE6AF3EB313FCFFB8F90842321DD08D48398F32B4A6BAD658CF5C8AB4025DA084F8E80FEBD376A4ED3E9341DC2FCD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojtu6fghEd2rVb+HK6OE2E4w== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D53130D571FB98B0A25910DD4BD7ACE36DDFA4120DC742F06F792326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Fix TNEW load forwarding with instable types. 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Sergey, Thanks for the patch! LGTM, considering the fixes made for the comments left by Max. On 11.05.23, Sergey Kaplun via Tarantool-patches wrote: > From: Mike Pall > > (cherry picked from commit d4c0c6e17ef7edf1f2893bc807746b80612e63e9) > > During loop unrolling IR instructions are coped, substituted and > re-emitted for the FOLD/CSE/etc. pipeline. Assume, we have the following > loop-carried dependency: we create a new table or load some stored one > depends on iteration number. In case when we copy the emitted ALOAD IR Side note: Changed the part after the colon the following way | we create a new table or load the stored one depending on the | iteration number. > instruction (from from the stored table), we copy it as is, including > loading type. But the ALOAD from the new table created (on the previous > iteration) should have nil type, so the assertion in `fwd_ahload()` is > failed. > > This patch replaces the assertion to `return 0` to avoid the assertion > failure and stop forwarding in such situations. > > But the emitted type-guarded ALOAD will lead to the persistent failure > of the assertion guard on the trace. Hence, another one fix should be Side note: Removed this sentence, as we discussed. > added. Also, TDUP IR is affected, too. > See also the issue mentioned in the test. > > Sergey Kaplun: > * added the description and the test for the problem > > Part of tarantool/tarantool#8516 > --- > > Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-994-instable-types-during-loop-unroll > PR: https://github.com/tarantool/tarantool/pull/8642 > Related issues: > * https://github.com/tarantool/tarantool/issues/8516 > * https://github.com/LuaJIT/LuaJIT/issues/994 > > I don't mention the 994 intentionally to avoid Mike bothering. Also, it > isn't the origin of this commit. Quite the opposite: as a result of this > backporting the following issue was created. > > I prefer to backport the patches (this one and the prospective for 994) > separately. So, after this patch is backported, it doesn't add any > critical bugs (always failing guard just creates a new side trace), but > helps to avoid conflicts for future backporting (sadly remembered > "Improve assertions."). > > src/lj_opt_mem.c | 3 +- > ...instable-types-during-loop-unroll.test.lua | 53 +++++++++++++++++++ > 2 files changed, 55 insertions(+), 1 deletion(-) > create mode 100644 test/tarantool-tests/lj-994-instable-types-during-loop-unroll.test.lua > > -- > 2.34.1 > -- Best regards, IM