Re: Missed compiler optimization issue in function select_rtable_names_for_explain

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: XChy <xxs_chy(at)outlook(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Missed compiler optimization issue in function select_rtable_names_for_explain
Date: 2024-05-22 09:51:00
Message-ID: 05C4ADF5-5E8C-49EC-8E0A-804BB946F1C7@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On 22 May 2024, at 11:27, XChy <xxs_chy(at)outlook(dot)com> wrote:
>
> Hi everyone,
> I'm a compiler developer working on detecting missed optimization in real-world applications. Recently, we found that LLVM missed a dead store elimination optimization in the PostgreSQL code (https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/ruleutils.c#L3794) in the master branch.

How is the memset in select_rtable_names_for_explain a dead-store? Even memset
calls could be optimized away from the EXPLAIN codepath I have a feeling it
would have to be many in a tight loop for it to be measurable even?

--
Daniel Gustafsson

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message XChy 2024-05-22 10:12:57 Re: Missed compiler optimization issue in function select_rtable_names_for_explain
Previous Message XChy 2024-05-22 09:27:44 Missed compiler optimization issue in function select_rtable_names_for_explain