llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Yuntao Liu" <liuyuntao12@huawei.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, "Ard Biesheuvel" <ardb@kernel.org>,
	"Fangrui Song" <maskray@google.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Andrew Davis" <afd@ti.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Mike Rapoport" <rppt@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	llvm@lists.linux.dev
Subject: Re: [PATCH-next v2] arm32: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION
Date: Mon, 11 Mar 2024 12:41:48 +0100	[thread overview]
Message-ID: <d3a7a06c-e82f-4e5e-9ceb-6c659a228bbe@app.fastmail.com> (raw)
In-Reply-To: <CAMuHMdXKk9S9voKVPvO+xvn1zFW3FnKyVHQGDkC7b9Ynkcnvmw@mail.gmail.com>

On Mon, Mar 11, 2024, at 10:14, Geert Uytterhoeven wrote:
> On Sat, Mar 9, 2024 at 2:24 PM liuyuntao (F) <liuyuntao12@huawei.com> wrote:
>> On 2024/3/9 16:20, Arnd Bergmann wrote:
>>
>> I tested this patch, the size improvement was only about one
>> ten-thousandth, and the compilation time had increased by about a quarter,
>> and the kernel did not boot.
>>
>> Strangely, LTO has actually increased the compilation time
>> significantly, which seems contrary to its purpose.
>
> The purpose of LTO is to reduce code size. Doing so requires more
> processing, hence the total build time increases.

I think llvm treats it purely as a performance optimization of
the resulting binary, allowing cross-unit inlining and constant
folding, but I don't think it actually tries or succeeds to make
the output smaller. I do remember seeing size improvements with
LTO using gcc in the past, but this never made it into the
mainline kernel. The last time someone tried to add it was 2022[1],
not sure why there was no follow-up.

     Arnd

[1] https://lore.kernel.org/lkml/20221114114344.18650-1-jirislaby@kernel.org/

      parent reply	other threads:[~2024-03-11 11:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240307151231.654025-1-liuyuntao12@huawei.com>
2024-03-08 13:15 ` [PATCH-next v2] arm32: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION Arnd Bergmann
2024-03-08 14:27   ` Ard Biesheuvel
2024-03-08 15:37     ` Ard Biesheuvel
2024-03-09  0:01       ` Ard Biesheuvel
2024-03-09  6:46         ` liuyuntao (F)
2024-03-09  6:42     ` liuyuntao (F)
2024-03-09  6:56     ` liuyuntao (F)
2024-03-09  6:14   ` liuyuntao (F)
2024-03-09  8:20     ` Arnd Bergmann
2024-03-09 13:24       ` liuyuntao (F)
2024-03-11  9:14         ` Geert Uytterhoeven
2024-03-11  9:39           ` liuyuntao (F)
2024-03-11 11:41           ` Arnd Bergmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d3a7a06c-e82f-4e5e-9ceb-6c659a228bbe@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=afd@ti.com \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=corbet@lwn.net \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=liuyuntao12@huawei.com \
    --cc=llvm@lists.linux.dev \
    --cc=maskray@google.com \
    --cc=robh@kernel.org \
    --cc=rppt@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).