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 1qU75x-00BhY0-L0 for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Aug 2023 14:57:01 +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 1qU75w-00Fl1y-5D for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Aug 2023 14:57:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qU75v-00Fl1m-Rb for pgsql-hackers@lists.postgresql.org; Thu, 10 Aug 2023 14:57:00 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qU75t-001i4c-Tp for pgsql-hackers@lists.postgresql.org; Thu, 10 Aug 2023 14:56:59 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4fe2de785e7so1554046e87.1 for ; Thu, 10 Aug 2023 07:56:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aiven.io; s=google; t=1691679416; x=1692284216; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BScteWtmfDmkz2jGs1U5iIGW474+H95FAfJeSLd1+bI=; b=kEgSthGvi44QG1VxXp7Dsr6X5JQ5f9hhs/yhZjbNu+pvvdxg8Uus7UUUyJNPxm6LsG tbA9j+KJDp5dsDltC2wkfi5/wXWkwMNqVf8gKxhbvx7SXzO+XZWH+LXZzGSe7njjaZIq shEKLMIH+RAJOhi2yYgdtongyRjw9lD9zS6Es= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691679416; x=1692284216; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BScteWtmfDmkz2jGs1U5iIGW474+H95FAfJeSLd1+bI=; b=RT4M5I0RlCWM3TMG0cbPQeNRq8k3Po6VTdKv669qV3k1D3qY5bMWziDZEHrDsz1CcV TMvGpfZSzr/39r5u4jvbiRLTo8hLT+Jiy1H4Xoz2JGvCzTvrHax5fq0zBrOib/hfihIY iZn8S3ysYis8KZiuDwYgWVQokLTfXA9UUZfRj+ARf9R9ERsnldJK08y4W2lRpI1EEmhY yNpzmVis1No7TDHbblr3yosVOpRiZ5rHiOsbwBzgs0H1jO7h12v+/m5YfQZsNHt4uUSz Ye8dV6a+mBKO5OTKMBy7i9PMnHuteqyWTMpzjYl+VstxCk0OdvgUzg+++odKWt1GRfak 9JWA== X-Gm-Message-State: AOJu0YxeqJubKOctb3VZkwPnoFjeC6DWPR8FdWR2UnT7ZYO9zbW83z5e acnDx6IbIbKmtTKo+OoULCLEQ66QRrEaDFooOhsN/5UESIkuNvkPFbAUzTeXOnwXxak0hHmEyk0 gtVjPTnCu651Cuk7XQUouz5KXTbsMmS4rDS2E2QWmN4QX0DFQwOEqKxFaXOr8W68JgkngUqdOdb CA2HxmFiViRd0Vd65dq4Y= X-Google-Smtp-Source: AGHT+IFvyB4/x9JW3sR/vUiYpv4hrBWHjtYPDlx66vAGk5FrQX+q+qaDQ0PGgTC/BvFfr90hyRGjNQ== X-Received: by 2002:a2e:730f:0:b0:2b9:e7d7:64bd with SMTP id o15-20020a2e730f000000b002b9e7d764bdmr2064077ljc.47.1691679415958; Thu, 10 Aug 2023 07:56:55 -0700 (PDT) Received: from aivenlaptop.localnet ([45.13.105.93]) by smtp.gmail.com with ESMTPSA id k17-20020adfe8d1000000b0031455482d1fsm2441372wrn.47.2023.08.10.07.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 07:56:55 -0700 (PDT) From: Ronan Dunklau To: PostgreSQL Hackers Cc: Thomas Munro Subject: Re: LLVM 16 (opaque pointers) Date: Thu, 10 Aug 2023 16:56:54 +0200 Message-ID: <6965583.LvFx2qVVIh@aivenlaptop> In-Reply-To: References: <_QHm0YiFiSfB_XrqU31J6iQ4rZZBBv_hBslJrGXEq0RT-anIrSFF2NVNT582qTw4H9CGeYURmFKHTtRw47tVMQ==@protonmail.internalid> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Le dimanche 21 mai 2023, 05:01:41 CEST Thomas Munro a =E9crit : > Hi, >=20 > Here is a draft version of the long awaited patch to support LLVM 16. > It's mostly mechanical donkeywork, but it took some time: this donkey > found it quite hard to understand the mighty getelementptr > instruction[1] and the code generation well enough to figure out all > the right types, and small mistakes took some debugging effort*. I > now finally have a patch that passes all tests. >=20 > Though it's not quite ready yet, I thought I should give this status > update to report that the main task is more or less complete, since > we're starting to get quite a few emails about it (mostly from Fedora > users) and there is an entry for it on the Open Items for 16 wiki > page. Comments/review/testing welcome. Hello Thomas, Thank you for this effort ! I've tested it against llvm 15 and 16, and found no problem with it. > 6. I need to go through the types again with a fine tooth comb, and > check the test coverage to look out for eg GEP array arithmetic with > the wrong type/size that isn't being exercised. I haven't gone through the test coverage myself, but I exercised the follow= ing=20 things:=20 - running make installcheck with jit_above_cost =3D 0 - letting sqlsmith hammer random queries at it for a few hours. This didn't show obvious issues. > *For anyone working with this type of IR generation code and > questioning their sanity, I can pass on some excellent advice I got > from Andres: build LLVM yourself with assertions enabled, as they > catch some classes of silly mistake that otherwise just segfault > > inscrutably on execution. I tried my hand at backporting it to previous versions, and not knowing=20 anything about it made me indeed question my sanity. It's quite easy for P= G=20 15, 14, 13. PG 12 is nothing insurmontable either, but PG 11 is a bit hairi= er=20 most notably due to to the change in fcinfo args representation. But I gues= s=20 that's also a topic for another day :-) Best regards, =2D- Ronan Dunklau