[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72mr96hE+7HUVedpqyg2jePYqeXGGgwpdPWb4Z_Dj7htYg@mail.gmail.com>
Date: Thu, 11 Sep 2025 20:56:45 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Heiko Carstens <hca@...ux.ibm.com>, Miguel Ojeda <ojeda@...nel.org>,
Vasily Gorbik <gor@...ux.ibm.com>, Alexander Gordeev <agordeev@...ux.ibm.com>,
Juergen Christ <jchrist@...ux.ibm.com>, linux-kernel@...r.kernel.org,
linux-s390@...r.kernel.org, Sven Schnelle <svens@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>
Subject: Re: [PATCH 1/3] Compiler Attributes: Add __assume macro
On Thu, Sep 11, 2025 at 3:32 AM Nathan Chancellor <nathan@...nel.org> wrote:
>
> It may be worth noting that careful analysis should be performed when
> adding this attribute since clang's documentation [1] (more on that
> below...) notes that it could hurt optimizations just as much as it
> could help it.
Yeah, it can be tricky, and I assume it may depend on the compiler
version too, i.e. the result could change over time. At least for
"build asserts relying on optimizations" it is clear if it stops
working, but here I assume we may have new compiler versions getting
released that stop doing what the developer intended. But perhaps is
not a problem in practice for the cases we care? Does someone know?
> Looking at this link sent me down a bit of a rabbit hole :) Prior to
> Clang 19.1.0 [2], assume was an OpenMP attribute, which has completely
> different semantics and errors out when used in the way the series does:
Oh... :(
Cheers,
Miguel
Powered by blists - more mailing lists