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 9ACEB4F62B1; Tue, 4 Jul 2023 20:18:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9ACEB4F62B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1688491119; bh=gXo0wlk9UUKf3INBsObh6JIwi8uHvG55xDyYGxRsnGE=; 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=jJyS97QeoPzxKhEyisKE7GOdXcmiPQoS5pl7cXWwU4lrewUPr5B6uS5cZcZG4t+AL AkurPIbatNeo7N9IrIEORuJD7qPoePpdPvCycrvkmNW7zngOLdg36fn0qWabr+E0OC AZNkPqld5BBT7ypszk/b54rCed0xNGUbjZTWqyd8= Received: from smtp37.i.mail.ru (smtp37.i.mail.ru [95.163.41.78]) (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 C84F94F314A for ; Tue, 4 Jul 2023 20:18:18 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C84F94F314A Received: by smtp37.i.mail.ru with esmtpa (envelope-from ) id 1qGjfN-004Ih0-OC; Tue, 04 Jul 2023 20:18:18 +0300 Date: Tue, 4 Jul 2023 17:09:26 +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: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD90EBD74C6BAAC9DBA8968F53F60D5B6C9418AD839521353BE182A05F53808504050165824CA92C4BAC3AC0F6A093CAAA137A2329350CEACD10297F94026AB99B6 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7548C33FFD72831AFEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063764FE777F378F21448638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8774A41024F0ED597789A81EE4F98C7F8117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B2D1539C52A686690A471835C12D1D977C4224003CC836476EB9C41850244470149FD398EE364050F0AC5B80A05675ACD4D0DA9BD313A0613B3661434B16C20ACC84D3B47A649675FE827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BAEB924C2B054B06E75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5519763E9AB8EE0DF93CD1140DCFA9D97F7CDB21AC13AC6B4F87CCE6106E1FC07E67D4AC08A07B9B06A1CB4668A9CA5FACB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34A08F09726D78E07B7AD4F0FCE2FE709576099F23BD157E82CB5B6318082BB45E5A0947C5A202669C1D7E09C32AA3244CAEE9E08E8A8364617013C2EBB607176B95A9E0DC41E9A4CFBAD658CF5C8AB4025DA084F8E80FEBD376A4ED3E9341DC2FCD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojtu6fghEd2rXR5k1UB0GsWw== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D531DE778E16EE585474B40AB78B41913EFE03EE00DEB249E58D2326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B 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, I've checked the patchset into all long-term branches in tarantool/luajit and bumped a new version in master, release/2.11 and release/2.10. 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 > 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 > 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