Le dimanche 21 mai 2023, 05:01:41 CEST Thomas Munro a écrit :
> Hi,
>
> 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.
>
> 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 following
things:
- running make installcheck with jit_above_cost = 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
anything about it made me indeed question my sanity. It's quite easy for PG
15, 14, 13. PG 12 is nothing insurmontable either, but PG 11 is a bit hairier
most notably due to to the change in fcinfo args representation. But I guess
that's also a topic for another day :-)
Best regards,
--
Ronan Dunklau