Re: Clang optimiser vs preproc.c

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Clang optimiser vs preproc.c
Date: 2023-12-16 05:32:07
Message-ID: CA+hUKGJm9B+UwGnNVgEMyvT8424=r8W9azWb8FvNXVMsqxDYxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Dec 16, 2023 at 4:19 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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 the thread slid off the radar
> screen.

I've never paid attention to the output of -ftime-report before but
this difference stands out pretty clearly with clang16:

---User Time--- --System Time-- --User+System-- ---Wall
Time--- --- Name ---
201.2266 ( 99.6%) 0.0074 ( 99.3%) 201.2341 ( 99.6%) 207.1308 (
99.6%) SLPVectorizerPass

The equivalent line for clang15 is:
3.0979 ( 64.8%) 0.0000 ( 0.0%) 3.0979 ( 64.8%) 3.0996 (
64.8%) SLPVectorizerPass

The thing Andres showed in that other thread was like this (though in
my output it's grown "#2") which is much of the time in 15, but "only"
goes up by a couple of seconds in 16, so it's not our primary problem:

9.1890 ( 73.1%) 0.0396 ( 23.9%) 9.2286 ( 72.4%) 9.6586 (
72.9%) Greedy Register Allocator #2

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-12-16 09:07:04 Re: Remove MSVC scripts from the tree
Previous Message Corey Huinker 2023-12-16 04:30:25 Re: Statistics Import and Export