Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w8J6O-000P9j-0F for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Apr 2026 14:32:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8J5N-006QNz-2E for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Apr 2026 14:31:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w8J5N-006QNp-1J for pgsql-hackers@lists.postgresql.org; Thu, 02 Apr 2026 14:31:53 +0000 Received: from fhigh-b4-smtp.messagingengine.com ([202.12.124.155]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w8J5M-00000000CRc-03Wd for pgsql-hackers@lists.postgresql.org; Thu, 02 Apr 2026 14:31:52 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id E24517A01D2; Thu, 2 Apr 2026 10:31:50 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Thu, 02 Apr 2026 10:31:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1775140310; x=1775226710; bh=O+ORkt79yLQO070cTttpelVHbtpZJNc5bsaGoGVt1Mg=; b= H8Ii5KKzSsNIFzMLfDTvlsG3IoUPbLCXcmWwLVrZq6VD6Ai75MD4vTbQVNJS7Vj/ GBhunUMy75nF9YFgLOIeUtX13uZ4OO8N7/f83qQRUTWlztrHIRS3UYDeEMbhIb0T WsnbwB69waUbfaHsfoirdqOt1kFJHYbYZIroDoF3SENluD4EWcy95HCQJNIpmxPe 70n9BdonsxjgB6fiCAsQqYDEBeKyn3WKdpx6mSDxBAlbH7IpzdJ7gVc+U4AtAN/i 5vi2ghZW9h03HtrnLBxj7d0A2mjzlGm1g81aP5CxOTcDiCJ0TUhf+7sLUFaE2r9J 2Ksx8pJB1Jg69NtsiM10HA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1775140310; x= 1775226710; bh=O+ORkt79yLQO070cTttpelVHbtpZJNc5bsaGoGVt1Mg=; b=i /uN4C3szurAEV6EHWg9+uU8MRcXFyqsjOnBFIxAgFgGejxKvWJ+V/vfr1Zp7vWCv yWkIb7jdp8GzdQAHnCC+SpBA16jyVKdRSZEHnqInOnb81G6KnxJLMTXUs4Se7IdW aMSwzMRDMzX7UHZ7lryHkOaktSFDXM5NMeneI6PpqOcBonYRpS0rQD+rXINmvcC/ HzfV+e3h5N5X9LGu9iDbsDchV44YR5d2e9mfSV8d5HGOkHnvv+Vp7IPZpfFh5SzU 60dedtIwLbQlH/XtvHqrn149LlE2LRA5ItOOD54IS+yljsKZM2KDpGrLSznEW9Zz z2nfl9KggDBpiOzYY7ysw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdeivdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh epfffhvfevuffkfhggtggugfgjsehtkefstddttdejnecuhfhrohhmpeetnhgurhgvshcu hfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrghtth gvrhhnpedtleelvdfgjedvffeiueekfeeuleffhfegfffhgfffkeevueehieehhfeigffh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnh gurhgvshesrghnrghrrgiivghlrdguvgdpnhgspghrtghpthhtohepiedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtoheprghnthhhohhnihhnrdgsohhnnhgvfhhohiesuggrth grughoghhhqhdrtghomhdprhgtphhtthhopehmrghthhgvuhhsshhsihhlvheljeesghhm rghilhdrtghomhdprhgtphhtthhopehthhhomhgrshdrmhhunhhrohesghhmrghilhdrtg homhdprhgtphhtthhopeguvghvrhhimhesghhunhguuhiirdhorhhgpdhrtghpthhtohep phhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpd hrtghpthhtohepthhglhesshhsshdrphhghhdrphgrrdhush X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 2 Apr 2026 10:31:49 -0400 (EDT) Date: Thu, 2 Apr 2026 10:31:48 -0400 From: Andres Freund To: Thomas Munro Cc: Tom Lane , Devrim =?utf-8?B?R8O8bmTDvHo=?= , PostgreSQL Hackers , Matheus Alcantara , Anthonin Bonnefoy Subject: Re: LLVM 22 Message-ID: References: <2805479.1775001311@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-04-02 16:20:41 +1300, Thomas Munro wrote: > On Wed, Apr 1, 2026 at 4:25 PM Thomas Munro wrote: > > Working on this, more shortly... I'm trying to figure out if Anthonin > > and Andres's feedback means the poison approach does nothing useful > > and we might as well just #ifdef out the lifetime.end stuff for LLVM > > >= 22 to fix the breakage today. > > Done. Hopefully midge and Devrim will now turn green :-) Thanks! > > Either way it looks like we need a patch to use alloca instead, which > > I'll also look into... > > I see a few options, but I need to hack on them for a while to figure > out the tradeoffs, or what I'm missing... after the freeze. I've experimented a bunch with this, it seems we need the larger changes done as part of the patchset for removing pointers from the expressions to actually allow recent-ish LLVM to optimize this. I did verify that what we did didn't have an effect with any other recent LLVM either. The real fix here might be to have a separate calling convention for the very common case of a scalar stable function with 1-3 arguments. We loose a fair bit of efficiency even in interpreted execution due to ferrying arguments, their nullness, and the nullness of the return value through memory. Greetings, Andres Freund