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 1qrEB8-003Epb-87 for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Oct 2023 09:09:54 +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 1qrEB5-00GQsV-2U for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Oct 2023 09:09:51 +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 <9erthalion6@gmail.com>) id 1qrEB4-00GQsM-N9 for pgsql-hackers@lists.postgresql.org; Fri, 13 Oct 2023 09:09:51 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from <9erthalion6@gmail.com>) id 1qrEAy-000GgJ-KY for pgsql-hackers@lists.postgresql.org; Fri, 13 Oct 2023 09:09:50 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-99357737980so306749766b.2 for ; Fri, 13 Oct 2023 02:09:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697188183; x=1697792983; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=eS68BDIkZJpkK/SaWxQvLZrQGlz1GgygYah5klxfloY=; b=LjIkoHIAPsGMdGhLRfdBC+efb3E4VVDLsavqeEakPUHN54cFkV0uAhogjWbUOm+oly XqHgH6DhmqVOD2CuF6Rg4Mh6zzHn9AzcSVT1d9/wfCmncCap58e8FDdDoJsUvgHNI2C7 OFn3xC1flXjdKeZ70PpEPoCVUEQUnmdtp9ykDNjMNnp3FFDqCBOVcmYwdjvrT3gbgxES stkdyLYS/JFBPokmSij22mQLGUdrxdeJRppnq/XAK+ZrQFyWsCAODQrpiYhSW/shPtZs e6BJqzBBwYPXimMrrdFTdzovxOrE6GmtryV6s8GIz6vp5JlBuvMyQNQZ+XgfTd4xvGQF 0kHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697188183; x=1697792983; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=eS68BDIkZJpkK/SaWxQvLZrQGlz1GgygYah5klxfloY=; b=JQZSwcUf3WjEwCqXd72FesUxT+WJEUQivmU1LqBwDg5aavfN+rw2wzzIfmBUox6aYi zA3RWamqK7IKw1RXxbdJpldPdl1AxvoaDF2hYamVIKtrZURP1COMJ81D38HChJGB2iCI 9wTxElhtw9l+5TyuqhyerS3S0anPUhfB1qg36q0ADzjVykqf9mNbsRNiwuj0Mix+ptLv 3I30le5HL0vY3Y7N7Bo8+i9gtgUFFCzcrZoiClLwvK0nMnl5eevK3+rVc9iFaMzdQFn9 7vfZS/FtQUolzzrB0oZ4Ig0TkFECF4PGKm+Py6FaOUs/qQ8Ow43mnnR2RVWr2HD6W+sp /KLA== X-Gm-Message-State: AOJu0YwyRkiTNGp9eszAotKJeFCEWqOnmsL/uVI+1GSoY4UfakN922EG Gn0VCYqR/BOdWqPllBdBJxw= X-Google-Smtp-Source: AGHT+IGOciQILQfz/a/sK8Pco2qrRhUK5FW/D1xRXo4URiyOl8bi43+WsnGnnvp2EjdeGcbsA6qGNQ== X-Received: by 2002:a17:906:32cb:b0:9ae:7622:eed9 with SMTP id k11-20020a17090632cb00b009ae7622eed9mr24044619ejk.50.1697188182730; Fri, 13 Oct 2023 02:09:42 -0700 (PDT) Received: from erthalion.local (dslb-178-012-047-187.178.012.pools.vodafone-ip.de. [178.12.47.187]) by smtp.gmail.com with ESMTPSA id la8-20020a170906ad8800b0099cce6f7d50sm12165237ejb.64.2023.10.13.02.09.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 02:09:42 -0700 (PDT) Date: Fri, 13 Oct 2023 11:06:21 +0200 From: Dmitry Dolgov <9erthalion6@gmail.com> To: Andres Freund Cc: Thomas Munro , Devrim =?utf-8?B?R8O8bmTDvHo=?= , PostgreSQL Hackers , Fabien COELHO , Ronan Dunklau Subject: Re: LLVM 16 (opaque pointers) Message-ID: <20231013090621.jmnlnij5slwiwwym@erthalion.local> References: <7d82e672-ed84-4fb1-b686-d477a7e2a043@mines-paristech.fr> <34036e05460e871024873d7542ceff0b2eaac13c.camel@gunduz.org> <20231012233120.chrw72oxc2pg3vpi@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231012233120.chrw72oxc2pg3vpi@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Thu, Oct 12, 2023 at 04:31:20PM -0700, Andres Freund wrote: > Hi, > > On 2023-10-11 21:59:50 +1300, Thomas Munro wrote: > > +#else > > + LLVMPassBuilderOptionsRef options; > > + LLVMErrorRef err; > > + int compile_optlevel; > > + char *passes; > > + > > + if (context->base.flags & PGJIT_OPT3) > > + compile_optlevel = 3; > > + else > > + compile_optlevel = 0; > > + > > + passes = psprintf("default,mem2reg,function(no-op-function),no-op-module", > > + compile_optlevel); > > I don't think the "function(no-op-function),no-op-module" bit does something > particularly useful? Right, looks like leftovers after verifying which passes were actually applied. My bad, could be removed. > 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.