Date: Thu, 02 Apr 2026 11:14:04 -0700
On Thursday, 2 April 2026 09:41:04 Pacific Daylight Time Jonathan Wakely via
Std-Proposals wrote:
> And as found by Adrian in the first post in the thread, turning all
> assertions into assumptions can hurt performance as much as it can help.
> You should use assumptions more conservatively, in targeted places where
> profiling has shown that it matters. See also
> https://discourse.llvm.org/t/llvm-assume-blocks-optimization/71609
The problem with that is that compilers also change, so the profiling at one
point in time could be wrong later. Or at the same time for a different
compiler.
That is not sustainable. I would hope that this is a temporary problem and
that, as Peter asked, providing *more* information to the compiler almost
never produces worse code.
Std-Proposals wrote:
> And as found by Adrian in the first post in the thread, turning all
> assertions into assumptions can hurt performance as much as it can help.
> You should use assumptions more conservatively, in targeted places where
> profiling has shown that it matters. See also
> https://discourse.llvm.org/t/llvm-assume-blocks-optimization/71609
The problem with that is that compilers also change, so the profiling at one
point in time could be wrong later. Or at the same time for a different
compiler.
That is not sustainable. I would hope that this is a temporary problem and
that, as Peter asked, providing *more* information to the compiler almost
never produces worse code.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel Data Center - Platform & Sys. Eng.
Received on 2026-04-02 18:14:11
