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 1qrJZR-003ehf-R9 for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Oct 2023 14:55: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 1qrJZP-001cwk-GT for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Oct 2023 14:55:20 +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 1qrJZN-001cwb-TA for pgsql-hackers@lists.postgresql.org; Fri, 13 Oct 2023 14:55:19 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qrJZL-000JAc-HT for pgsql-hackers@lists.postgresql.org; Fri, 13 Oct 2023 14:55:17 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id A48565C0439; Fri, 13 Oct 2023 10:55:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Fri, 13 Oct 2023 10:55:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1697208913; x=1697295313; bh=ky hq8MYt//p3rGIDT7dYcJS6BDjuUrbbPP/yJWNxNa0=; b=fS0xZlljfEqSjHMzi1 iZ03LptU/NBGsqMpDEBqPA3X9Kp/0JjX9mN+LaGTw+qcqjTuXeasmXeQn8WKt2hk NLUHR1Muo4LZ+izK8Lebo1s30nEliSd+CB52a9zYgRpOV0wORNOf8mRC382WYjfj R551OSCgVLe6IIFfiTkb2J9+Mpd3FAaLWgpSbJOCscoZ4/RY+JbB9rrW4AxKIYKN sHK5LIw5mwM35J0LwrmJ8+zdBZSJt8uFl0UrdfNG00fjG7OKMUm+ip8bh13BRBeN tKLol1WQK8p4P3sTx/JHYrvf7B4mxpFKq6tZmC45nxSuizAZKiBJx4K3H3ASXnfb nYTg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1697208913; x=1697295313; bh=kyhq8MYt//p3r GIDT7dYcJS6BDjuUrbbPP/yJWNxNa0=; b=ShFdABMX4Cv6CnX5lzxfVPKX+beM0 7/RfgU4sysK6bYJvWpLimfC2gXGekVt7m9RN8f1qFpqw5swF0P2Nn+t6aV+sX/ay mwwowCtY3MY20gDSIqKjofio+0vWbwN+Z1AOOddwmEFxISakVMFDcoXhTVSv/0wt uubp6Zpy3NVZItRzAdz1SHqKDGI8zygXZCe/GtKoui08g1R7t3mvyGlBthlxKsrx VIqhR5xumve6enINaB0R/pEsIkoJW5tQZ/tZa+o5ucMYXg967n3s9gmNvffFW+9c /sOYw0gCO48gmGWId0ErHMpW6YKyfrO4e1zozUKDOryAkAJ+o1v4CYHCg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrieefgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedvffefvefhteevffegieetfefhtddvffejvefhueetgeeludehteevudei tedtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Oct 2023 10:55:12 -0400 (EDT) Date: Fri, 13 Oct 2023 07:55:10 -0700 From: Andres Freund To: Dmitry Dolgov <9erthalion6@gmail.com> Cc: Thomas Munro , Devrim =?utf-8?B?R8O8bmTDvHo=?= , PostgreSQL Hackers , Fabien COELHO , Ronan Dunklau Subject: Re: LLVM 16 (opaque pointers) Message-ID: <20231013145510.aq3qiqig6rw5x72v@awork3.anarazel.de> References: <7d82e672-ed84-4fb1-b686-d477a7e2a043@mines-paristech.fr> <34036e05460e871024873d7542ceff0b2eaac13c.camel@gunduz.org> <20231012233120.chrw72oxc2pg3vpi@awork3.anarazel.de> <20231013090621.jmnlnij5slwiwwym@erthalion.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231013090621.jmnlnij5slwiwwym@erthalion.local> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-10-13 11:06:21 +0200, Dmitry Dolgov wrote: > > On Thu, Oct 12, 2023 at 04:31:20PM -0700, Andres Freund wrote: > > I also don't think we should add the mem2reg pass outside of -O0 - running it > > after a real optimization pipeline doesn't seem useful and might even make the > > code worse? mem2reg is included in default (and obviously also in O3). > > My understanding was that while mem2reg is included everywhere above > -O0, this set of passes won't hurt. But yeah, if you say it could > degrade the final result, it's better to not do this. I'll update this > part. It's indeed included anywhere above that, but adding it explicitly to the schedule means it's excuted twice: echo 'int foo(int a) { return a / 343; }' | clang-16 -emit-llvm -x c -c -o - -S -|sed -e 's/optnone//'|opt-17 -debug-pass-manager -passes='default,mem2reg' -o /dev/null 2>&1|grep Promote Running pass: PromotePass on foo (2 instructions) Running pass: PromotePass on foo (2 instructions) The second one is in a point in the pipeline where it doesn't help. It also requires another analysis pass to be executed unnecessarily. Greetings, Andres Freund