Re: LLVM 16 (opaque pointers)
Dmitry Dolgov <9erthalion6@gmail.com>
From: Dmitry Dolgov <9erthalion6@gmail.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-06-04T09:33:42Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
jit: Adjust back-patch of f90b4a84 to 12 and 13.
- 9ad98627614b 12.17 landed
- 7c070e224c4a 13.13 landed
-
Log LLVM library version in configure output.
- 0a6e2c7f8694 11.22 landed
- 527e62a5e5d7 12.17 landed
- a13b63c788a3 13.13 landed
- 03e749c2b89e 14.10 landed
- 0e49e23782c5 15.5 landed
- 3b0f20f6ce14 16.1 landed
- 5e4dacb9878c 17.0 landed
-
jit: Changes for LLVM 17.
- 7da915e33abf 12.17 landed
- 53c4dabe18d3 13.13 landed
- 0a8b7d5c1126 14.10 landed
- b60e3ac7603d 15.5 landed
- 774185056834 16.1 landed
- 76200e5ee469 17.0 landed
-
jit: Supply LLVMGlobalGetValueType() for LLVM < 8.
- 60596f148a66 16.1 landed
- d701f0d1f3e7 12.17 landed
- 981292c19f38 13.13 landed
- ee3e4c41f354 14.10 landed
- b2e097788663 15.5 landed
- f90b4a846b32 17.0 landed
-
jit: Support opaque pointers in LLVM 16.
- 15ddc9725eb7 12.17 landed
- f28956b239f1 13.13 landed
- 82d9a782a296 14.10 landed
- eed1feb3fee1 15.5 landed
- 74d19ec096df 16.1 landed
- 37d5babb5cfa 17.0 landed
-
jit: Reference function pointer types via llvmjit_types.c.
- df99ddc70b97 14.0 cited
Attachments
- 0002-LLVM-17.patch (text/x-diff)
> On Mon, May 22, 2023 at 03:38:44PM +1200, Thomas Munro wrote: > Further changes are already needed for their "main" branch (LLVM > 17-to-be), so this won't quite be enough to shut seawasp up. At a > glance, we will need to change from the "old pass manager" API that > has recently been vaporised[1] > (llvm-c/Transforms/PassManagerBuilder.h) to the new one[2][3] > (llvm-c/Transforms/PassBuilder.h), which I suspect/hope will be as > simple as changing llvmjit.c to call LLVMRunPasses() with a string > describing the passes we want in "opt -passes" format, instead of our > code that calls LLVMAddFunctionInlingPass() etc. But that'll be a > topic for another day, and another thread. > > [1] https://github.com/llvm/llvm-project/commit/0aac9a2875bad4f065367e4a6553fad78605f895 > [2] https://llvm.org/docs/NewPassManager.html > [3] https://reviews.llvm.org/D102136 Thanks for tackling the topic! I've tested it with a couple of versions, LLVM 12 that comes with my Gentoo box, LLVM 15 build from sources and the modified version of patch adopted for LLVM 17 (build form sources as well). In all three cases everything seems to be working fine. Simple benchmarking with a query stolen from some other jit thread (pgbench running single client with multiple unions of selects a-la SELECT a, count(*), sum(b) FROM test WHERE c = 2 GROUP BY a) show some slight performance differences, but nothing dramatic so far. LLVM 17 version produces the lowest latency, with faster generation, inlining and optimization, but slower emission time. LLVM 12 version produces the largest latencies with everything except emission timings being slower. LLVM 15 is somewhere in between. I'll continue reviewing and, for the records, attach adjustments I was using for LLVM 17 (purely for testing, not taking into account other versions), in case if I've missed something.