Re: JIT compiling with LLVM v12.2 - Mailing list pgsql-hackers

From Andres Freund
Subject Re: JIT compiling with LLVM v12.2
Date
Msg-id 20180321213624.mwtykxvqpygg6kf7@alap3.anarazel.de
Whole thread Raw
In response to Re: JIT compiling with LLVM v12.2  (Andres Freund <andres@anarazel.de>)
Responses Re: JIT compiling with LLVM v12.2  (Thomas Munro <thomas.munro@enterprisedb.com>)
List pgsql-hackers
Hi,

On 2018-03-21 14:21:01 -0700, Andres Freund wrote:
> I think it's I that did something wrong not you. And the architecture
> thing is a non-issue, because we're taking the target triple from the
> right place.  I think it's a separate issue. Notably the generated code
> is apparently corrupt, when reading in the generated bitcode:
> 
> $ opt-6.0 -O3 -S < /tmp/data/6814.1.bc|less
> opt-6.0: <stdin>: error: Invalid record (Producer: 'LLVM6.0.0' Reader: 'LLVM 6.0.0')
> 
> I suspect there's a 32bit vs 64bit confusion in the expression code
> somewhere, might've accidentally used a 64bit type for Datum somewhere
> or such. Will compile an LLVM with assertions enabled, to figure this
> out (which verifies this kinda thing).

Yup, that's it.  Found it by searching for 64bit references, while LLVM
was compiling.  I've pushed quickfixes (for the 32 warnings, as well as
for the 32bit x86 issue, as for configure typos).

Passes
PGOPTIONS='-c jit_above_cost=0' make -s check
now.

I'll still run 32bit through an LLVM w/ assert run once finished (takes
~30min to compile LLVM).

Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Multiple-output-file make rules: We're Doing It Wrong
Next
From: Andres Freund
Date:
Subject: Re: JIT compiling with LLVM v12.2