Re: JIT compiling with LLVM v12.2

2018-03-30 Thread Andres Freund
On March 30, 2018 10:04:25 AM PDT, Konstantin Knizhnik wrote: > > >On 30.03.2018 18:54, Andres Freund wrote: >> On 2018-03-30 15:12:05 +0300, Konstantin Knizhnik wrote: >>> I have repeated performance tests at my computer and find out some >>> regression comparing

Re: JIT compiling with LLVM v12.2

2018-03-30 Thread Konstantin Knizhnik
On 30.03.2018 18:54, Andres Freund wrote: On 2018-03-30 15:12:05 +0300, Konstantin Knizhnik wrote: I have repeated performance tests at my computer and find out some regression comparing with previous JIT version. Previously JIT provides about 2 times improvement at TPC-H Q1. Now the

Re: JIT compiling with LLVM v12.2

2018-03-30 Thread Andres Freund
On 2018-03-30 15:12:05 +0300, Konstantin Knizhnik wrote: > I have repeated performance tests at my computer and find out some > regression comparing with previous JIT version. > Previously JIT provides about 2 times improvement at TPC-H Q1. Now the > difference is reduced to 1.4 without parallel

Re: JIT compiling with LLVM v12.2

2018-03-30 Thread Konstantin Knizhnik
On 30.03.2018 02:14, Andres Freund wrote: Hi, On 2018-03-29 19:57:42 +0700, John Naylor wrote: Hi Andres, I spent some time over pouring over the JIT README, and I've attached a patch with some additional corrections as well as some stylistic suggestions. The latter may be debatable, but I'm

Re: JIT compiling with LLVM v12.2

2018-03-29 Thread Andres Freund
Hi, On 2018-03-29 19:57:42 +0700, John Naylor wrote: > Hi Andres, > I spent some time over pouring over the JIT README, and I've attached > a patch with some additional corrections as well as some stylistic > suggestions. The latter may be debatable, but I'm sure you can take > and pick as you

Re: JIT compiling with LLVM v12.2

2018-03-29 Thread John Naylor
Hi Andres, I spent some time over pouring over the JIT README, and I've attached a patch with some additional corrections as well as some stylistic suggestions. The latter may be debatable, but I'm sure you can take and pick as you see fit. If there are cases where I misunderstood your intent,

Re: JIT compiling with LLVM v12.2

2018-03-26 Thread Andres Freund
Hi, On 2018-03-25 00:07:11 +1300, Thomas Munro wrote: > I spotted a couple of typos and some very minor coding details -- see > please see attached. Thanks, applying 0001 in a bit. > From 648e303072c77e781eca2bb06f488f6be9ccac84 Mon Sep 17 00:00:00 2001 > From: Thomas Munro

Re: JIT compiling with LLVM v12.2

2018-03-24 Thread Thomas Munro
Thomas Munro wrote: > typos A dead line. -- Thomas Munro http://www.enterprisedb.com 0003-Remove-dead-code.patch Description: Binary data

Re: JIT compiling with LLVM v12.2

2018-03-24 Thread Thomas Munro
Hi Andres, I spotted a couple of typos and some very minor coding details -- see please see attached. -- Thomas Munro http://www.enterprisedb.com 0001-Correct-some-minor-typos-in-the-new-JIT-code.patch Description: Binary data 0002-Minor-code-cleanup-for-llvmjit_wrap.cpp.patch Description:

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Andres Freund
Hi, On 2018-03-22 16:09:51 +1300, Thomas Munro wrote: > On Thu, Mar 22, 2018 at 1:36 PM, Thomas Munro > wrote: > > I've now run out of things to complain about for now. Nice work! > > I jumped on a POWER8 box. As expected, the same breakage occurs. So > I

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Thomas Munro
On Thu, Mar 22, 2018 at 1:36 PM, Thomas Munro wrote: > I've now run out of things to complain about for now. Nice work! I jumped on a POWER8 box. As expected, the same breakage occurs. So I hacked LLVM 6.0 thusly: diff --git

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Thomas Munro
On Wed, Mar 21, 2018 at 8:06 PM, Thomas Munro wrote: > "make -C src/interfaces/ecpg/test check" consistently fails on my macOS > machine: > > test compat_oracle/char_array ... stderr source FAILED I can't reproduce this anymore on the tip of your jit branch.

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Thomas Munro
On Thu, Mar 22, 2018 at 11:46 AM, Andres Freund wrote: > On 2018-03-22 11:36:47 +1300, Thomas Munro wrote: >> Not sure if we'll want to try to actively identify and avoid known >> buggy versions or not? > > I'm currently not inclined to invest a lot of effort into it, besides

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Andres Freund
Hi, On 2018-03-22 11:36:47 +1300, Thomas Munro wrote: > On Thu, Mar 22, 2018 at 10:59 AM, Andres Freund wrote: > > On 2018-03-22 10:50:52 +1300, Thomas Munro wrote: > >> Hmm. There is no LLVM 6 in backports. > > > > I think there now is: > >

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Thomas Munro
On Thu, Mar 22, 2018 at 10:59 AM, Andres Freund wrote: > On 2018-03-22 10:50:52 +1300, Thomas Munro wrote: >> Hmm. There is no LLVM 6 in backports. > > I think there now is: > https://packages.debian.org/search?keywords=llvm=names=all=stretch-backports > > Package

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Andres Freund
On 2018-03-22 10:50:52 +1300, Thomas Munro wrote: > On Thu, Mar 22, 2018 at 10:44 AM, Andres Freund wrote: > > On 2018-03-21 23:10:27 +1300, Thomas Munro wrote: > >> Next up, I have an arm64 system running Debian 9.4. It bombs in > >> "make check" and in simple tests: > > > >

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Thomas Munro
On Thu, Mar 22, 2018 at 10:50 AM, Thomas Munro wrote: > On Thu, Mar 22, 2018 at 10:44 AM, Andres Freund wrote: >> On 2018-03-21 23:10:27 +1300, Thomas Munro wrote: >>> Next up, I have an arm64 system running Debian 9.4. It bombs in >>> "make

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Thomas Munro
On Thu, Mar 22, 2018 at 10:44 AM, Andres Freund wrote: > On 2018-03-21 23:10:27 +1300, Thomas Munro wrote: >> Next up, I have an arm64 system running Debian 9.4. It bombs in >> "make check" and in simple tests: > > Any chance you could try w/ LLVM 6? It looks like some parts

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Thomas Munro
On Thu, Mar 22, 2018 at 10:36 AM, Andres Freund wrote: > 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

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Andres Freund
Hi, On 2018-03-22 09:31:12 +1300, Thomas Munro wrote: > Aside from whatever problem is causing this, we can see that there is > no top-level handling of exceptions. That's probably fine if we are > in a no throw scenario (unless there is something seriously corrupted, > as is probably the case

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Andres Freund
Hi, On 2018-03-21 23:10:27 +1300, Thomas Munro wrote: > Next up, I have an arm64 system running Debian 9.4. It bombs in > "make check" and in simple tests: Any chance you could try w/ LLVM 6? It looks like some parts of ORC only got aarch64 in LLVM 6. I didn't *think* those were necessary,

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Andres Freund
Hi, On 2018-03-22 10:09:23 +1300, Thomas Munro wrote: > > FWIW, a 32bit chroot, on a 64bit kernel works: > > > > 2018-03-21 20:57:56.576 UTC [3708] DEBUG: successfully loaded LLVM in > > current session > > 2018-03-21 20:57:56.577 UTC [3708] DEBUG: JIT detected CPU "skylake", with > >

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Thomas Munro
On Thu, Mar 22, 2018 at 9:59 AM, Andres Freund wrote: > On 2018-03-22 09:51:01 +1300, Thomas Munro wrote: >> Hah, that makes sense. I tried setting cpu to "x86", and now it fails >> differently: > > Did you change the variable, or replace the value that's passed to the >

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Andres Freund
On 2018-03-22 09:51:01 +1300, Thomas Munro wrote: > On Thu, Mar 22, 2018 at 9:09 AM, Andres Freund wrote: > > Hi, > > > > On 2018-03-22 09:00:19 +1300, Thomas Munro wrote: > >> 64 bit CPU, 32 bit OS. I didn't try Debian multi-arch i386 support on > >> an amd64 system, but

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Thomas Munro
On Thu, Mar 22, 2018 at 9:09 AM, Andres Freund wrote: > Hi, > > On 2018-03-22 09:00:19 +1300, Thomas Munro wrote: >> 64 bit CPU, 32 bit OS. I didn't try Debian multi-arch i386 support on >> an amd64 system, but that's probably an easier way to do this if you >> already have

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Dagfinn Ilmari Mannsåker
Andres Freund writes: > Hi, > > On 2018-03-21 20:06:49 +1300, Thomas Munro wrote: >> On Wed, Mar 21, 2018 at 4:07 PM, Andres Freund wrote: >> > Indeed. I've pushed a rebased version now, that basically just fixes the >> > issue Thomas observed. >> >> I

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Thomas Munro
On Thu, Mar 22, 2018 at 9:06 AM, Andres Freund wrote: > On 2018-03-21 23:10:27 +1300, Thomas Munro wrote: >> Next up, I have an arm64 system running Debian 9.4. It bombs in >> "make check" and in simple tests: > > Hum. Is it running a 32bit or 64 bit kernel/os? checking size

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Andres Freund
Hi, On 2018-03-22 09:00:19 +1300, Thomas Munro wrote: > On Thu, Mar 22, 2018 at 8:47 AM, Andres Freund wrote: > > On 2018-03-21 20:06:49 +1300, Thomas Munro wrote: > >> On Wed, Mar 21, 2018 at 4:07 PM, Andres Freund wrote: > >> > Indeed. I've pushed a

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Andres Freund
On 2018-03-21 23:10:27 +1300, Thomas Munro wrote: > On Wed, Mar 21, 2018 at 8:06 PM, Thomas Munro > wrote: > > On Wed, Mar 21, 2018 at 4:07 PM, Andres Freund wrote: > >> Indeed. I've pushed a rebased version now, that basically just fixes the >

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Andres Freund
Hi, On 2018-03-21 08:26:28 +0100, Catalin Iacob wrote: > On Wed, Mar 21, 2018 at 4:07 AM, Andres Freund wrote: > > Indeed. I've pushed a rebased version now, that basically just fixes the > > issue Thomas observed. > > Testing 2d6f2fba from your repository configured

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Thomas Munro
On Thu, Mar 22, 2018 at 8:47 AM, Andres Freund wrote: > On 2018-03-21 20:06:49 +1300, Thomas Munro wrote: >> On Wed, Mar 21, 2018 at 4:07 PM, Andres Freund wrote: >> > Indeed. I've pushed a rebased version now, that basically just fixes the >> > issue

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Andres Freund
Hi, On 2018-03-21 20:06:49 +1300, Thomas Munro wrote: > On Wed, Mar 21, 2018 at 4:07 PM, Andres Freund wrote: > > Indeed. I've pushed a rebased version now, that basically just fixes the > > issue Thomas observed. > > I set up a 32 bit i386 virtual machine and installed

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Thomas Munro
On Wed, Mar 21, 2018 at 8:06 PM, Thomas Munro wrote: > On Wed, Mar 21, 2018 at 4:07 PM, Andres Freund wrote: >> Indeed. I've pushed a rebased version now, that basically just fixes the >> issue Thomas observed. > > I set up a 32 bit i386 virtual

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Catalin Iacob
On Wed, Mar 21, 2018 at 4:07 AM, Andres Freund wrote: > Indeed. I've pushed a rebased version now, that basically just fixes the > issue Thomas observed. Testing 2d6f2fba from your repository configured --with-llvm I noticed some weird things in the configure output. Without

Re: JIT compiling with LLVM v12.2

2018-03-21 Thread Thomas Munro
On Wed, Mar 21, 2018 at 4:07 PM, Andres Freund wrote: > Indeed. I've pushed a rebased version now, that basically just fixes the > issue Thomas observed. I set up a 32 bit i386 virtual machine and installed Debian 9.4. Compiler warnings: gcc -Wall -Wmissing-prototypes

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Andres Freund
Hi, On 2018-03-20 23:03:13 -0400, Stephen Frost wrote: > Greetings, > > * Andres Freund (and...@anarazel.de) wrote: > > On 2018-03-20 19:29:55 -0700, Andres Freund wrote: > > > On 2018-03-21 15:22:08 +1300, Thomas Munro wrote: > > > > Somehow your configure test correctly concludes that my $CC

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Stephen Frost
Greetings, * Andres Freund (and...@anarazel.de) wrote: > On 2018-03-20 19:29:55 -0700, Andres Freund wrote: > > On 2018-03-21 15:22:08 +1300, Thomas Munro wrote: > > > Somehow your configure test correctly concludes that my $CC (clang > > > 4.0) doesn't support -fexcess-precision=standard but

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Andres Freund
On 2018-03-20 19:29:55 -0700, Andres Freund wrote: > Hi, > > On 2018-03-21 15:22:08 +1300, Thomas Munro wrote: > > Somehow your configure test correctly concludes that my $CC (clang > > 4.0) doesn't support -fexcess-precision=standard but that my $CXX > > (clang++ 4.0) does, despite producing a

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Andres Freund
Hi, On 2018-03-21 15:22:08 +1300, Thomas Munro wrote: > Somehow your configure test correctly concludes that my $CC (clang > 4.0) doesn't support -fexcess-precision=standard but that my $CXX > (clang++ 4.0) does, despite producing a nearly identical warning: Yea, there was a copy & pasto

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Thomas Munro
On Wed, Mar 21, 2018 at 1:50 PM, Andres Freund wrote: > On 2018-03-20 03:14:55 -0700, Andres Freund wrote: >> My current plan is to push the first few commits relatively soon, give >> the BF a few cycles to shake out. Set up a few BF animals with each >> supported LLVM

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Andres Freund
Hi, On 2018-03-20 03:14:55 -0700, Andres Freund wrote: > My current plan is to push the first few commits relatively soon, give > the BF a few cycles to shake out. Set up a few BF animals with each > supported LLVM version. Then continue mergin. I've done that. I'll set up a number of BF

Re: JIT compiling with LLVM v12.2

2018-03-20 Thread Andres Freund
Hi, I've pushed a revised and rebased version of my JIT patchset. The git tree is at https://git.postgresql.org/git/users/andresfreund/postgres.git in the jit branch https://git.postgresql.org/gitweb/?p=users/andresfreund/postgres.git;a=shortlog;h=refs/heads/jit There's a lot of tiny