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.94.2) (envelope-from ) id 1s9icy-004Yme-JE for pgsql-general@arkaria.postgresql.org; Wed, 22 May 2024 09:51:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s9icw-00FMqc-KZ for pgsql-general@arkaria.postgresql.org; Wed, 22 May 2024 09:51:18 +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.94.2) (envelope-from ) id 1s9icw-00FMqU-5Y for pgsql-general@lists.postgresql.org; Wed, 22 May 2024 09:51:18 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9ics-001QnG-HB for pgsql-general@postgresql.org; Wed, 22 May 2024 09:51:16 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 07A9A301C0E3 for ; Wed, 22 May 2024 11:51:11 +0200 (CEST) Received: from s981.loopia.se (unknown [172.22.191.6]) by s807.loopia.se (Postfix) with ESMTP id EC84C2E29B40; Wed, 22 May 2024 11:51:10 +0200 (CEST) Received: from s473.loopia.se (unknown [172.22.191.5]) by s981.loopia.se (Postfix) with ESMTP id E9C6022B17D7; Wed, 22 May 2024 11:51:10 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s473.loopia.se (amavisd-new); dkim=pass (2048-bit key) header.d=yesql.se Received: from s981.loopia.se ([172.22.191.5]) by s473.loopia.se (s473.loopia.se [172.22.190.13]) (amavisd-new, port 10024) with UTF8LMTP id AqVRt84jZVOI; Wed, 22 May 2024 11:51:10 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.193 Received: from smtpclient.apple (customer-89-255-232-193.stosn.net [89.255.232.193]) (Authenticated sender: daniel@yesql.se) by s981.loopia.se (Postfix) with ESMTPSA id 6863822B17C8; Wed, 22 May 2024 11:51:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yesql.se; s=loopiadkim1707475645; t=1716371470; bh=y7OVZNRpeRMG2hvANZQ6/vcIjiA3VWj2t5OQX5YM0EA=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=p9KvcUcmhDOGs2u8b3PFEaJn2VqrJTEjVH0vY6zGeIFN6jjhhtQM+iZkEk5Nv/SVe Lwj46Sb9CnG3S0Kx74XHHr/cLbrPqdz4CehqkfsERLEJt19doyeOx4OnFRG9iGi/4l R5KxkX5X0h+r/nkdLvpPDvfvQPqXbzi3gfc9OVN1nngezVWuWFhPzNshqsAaYgZG31 ewBW+lkerU82pfZaF5DuJaLZ+n7yu+apK2zUT1Rr+Y2iUydGqtAO9oZQw98slyHpep uxbcDOIF3QAYOEPed2FdPGdDtVRiCA8Ue715GukWwD/p8m1hBgz38LlyrBbwHlnQMh 1ksyWKsrpp3/Q== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Subject: Re: Missed compiler optimization issue in function select_rtable_names_for_explain From: Daniel Gustafsson In-Reply-To: Date: Wed, 22 May 2024 11:51:00 +0200 Cc: pgsql-general@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <05C4ADF5-5E8C-49EC-8E0A-804BB946F1C7@yesql.se> References: To: XChy X-Mailer: Apple Mail (2.3774.500.171.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 22 May 2024, at 11:27, XChy wrote: >=20 > Hi everyone, > I'm a compiler developer working on detecting missed optimization in = real-world applications. Recently, we found that LLVM missed a dead = store elimination optimization in the PostgreSQL code = (https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/ru= leutils.c#L3794) in the master branch. How is the memset in select_rtable_names_for_explain a dead-store? Even = memset calls could be optimized away from the EXPLAIN codepath I have a feeling = it would have to be many in a tight loop for it to be measurable even? -- Daniel Gustafsson