Re: Clang optimiser vs preproc.c

2023-12-20 Thread Alexander Lakhin
Hello Thomas, 19.12.2023 07:20, Thomas Munro wrote: On Tue, Dec 19, 2023 at 11:42 AM Thomas Munro wrote: Hrmph. Well something weird is going on, but it might indeed involve me being confused about debug options of the compiler itself. How can one find out which build options were used for c

Re: Clang optimiser vs preproc.c

2023-12-18 Thread Thomas Munro
On Tue, Dec 19, 2023 at 11:42 AM Thomas Munro wrote: > Hrmph. Well something weird is going on, but it might indeed involve > me being confused about debug options of the compiler itself. How can > one find out which build options were used for clang/llvm compiler + > libraries? My earlier repo

Re: Clang optimiser vs preproc.c

2023-12-18 Thread Thomas Munro
On Sun, Dec 17, 2023 at 1:29 AM Andres Freund wrote: > On 2023-12-15 22:19:56 -0500, Tom Lane wrote: > > Thomas Munro writes: > > > On Sat, Dec 16, 2023 at 3:44 PM Tom Lane wrote: > > >> Thomas Munro writes: > > >>> FYI, it looks like there is a big jump in CPU time to compile preproc.c > > >>

Re: Clang optimiser vs preproc.c

2023-12-16 Thread Andres Freund
Hi, On 2023-12-15 22:19:56 -0500, Tom Lane wrote: > Thomas Munro writes: > > On Sat, Dec 16, 2023 at 3:44 PM Tom Lane wrote: > >> Thomas Munro writes: > >>> FYI, it looks like there is a big jump in CPU time to compile preproc.c > >>> at -O2: > >>> clang15: ~16s > >>> clang16: ~211s > >>> clan

Re: Clang optimiser vs preproc.c

2023-12-15 Thread Thomas Munro
On Sat, Dec 16, 2023 at 4:19 PM Tom Lane wrote: > We actually noticed this or a closely-related problem before [1] > and briefly discussed the possibility of rearranging the generated > code to make it less indigestible to clang. But there was no concrete > idea about what to do specifically, and

Re: Clang optimiser vs preproc.c

2023-12-15 Thread Tom Lane
Thomas Munro writes: > On Sat, Dec 16, 2023 at 3:44 PM Tom Lane wrote: >> Thomas Munro writes: >>> FYI, it looks like there is a big jump in CPU time to compile preproc.c at >>> -O2: >>> clang15: ~16s >>> clang16: ~211s >>> clang17: ~233s >> What are the numbers for gram.c? > clang15: ~3.8s >

Re: Clang optimiser vs preproc.c

2023-12-15 Thread Thomas Munro
On Sat, Dec 16, 2023 at 3:44 PM Tom Lane wrote: > Thomas Munro writes: > > FYI, it looks like there is a big jump in CPU time to compile preproc.c at > > -O2: > > > clang15: ~16s > > clang16: ~211s > > clang17: ~233s > > What are the numbers for gram.c? clang15: ~3.8s clang16: ~3.2s clang17: ~2

Re: Clang optimiser vs preproc.c

2023-12-15 Thread Tom Lane
Thomas Munro writes: > FYI, it looks like there is a big jump in CPU time to compile preproc.c at > -O2: > clang15: ~16s > clang16: ~211s > clang17: ~233s What are the numbers for gram.c? regards, tom lane

Clang optimiser vs preproc.c

2023-12-15 Thread Thomas Munro
Hi, FYI, it looks like there is a big jump in CPU time to compile preproc.c at -O2: clang15: ~16s clang16: ~211s clang17: ~233s First noticed on FreeBSD (where the system cc is now clang16), but reproduced also on Debian (via apt.llvm.org packages).