Thread overview
[Issue 20990] Optimizer should move cold branches to the end of the function
Jun 28, 2020
Walter Bright
Jun 28, 2020
Walter Bright
Jun 28, 2020
Iain Buclaw
Jun 30, 2020
Walter Bright
Jul 05, 2020
Dlang Bot
Jul 06, 2020
Dlang Bot
June 28, 2020
https://issues.dlang.org/show_bug.cgi?id=20990

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |performance

--
June 28, 2020
https://issues.dlang.org/show_bug.cgi?id=20990

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
(In reply to Walter Bright from comment #0)
> assert is a cold branch, and DMD move the assert to the end for the example:

I meant it does "not move" the assert.

--
June 28, 2020
https://issues.dlang.org/show_bug.cgi?id=20990

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw@gdcproject.org

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> ---
(In reply to Walter Bright from comment #1)
> (In reply to Walter Bright from comment #0)
> > assert is a cold branch, and DMD move the assert to the end for the example:
> 
> I meant it does "not move" the assert.

Everything that follows the assert should also be considered cold too.  Though hopefully "unreachable" warnings/errors would occur before that point.

--
June 30, 2020
https://issues.dlang.org/show_bug.cgi?id=20990

--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> ---
(In reply to Iain Buclaw from comment #2)
> Everything that follows the assert should also be considered cold too.

Actually, it is not just cold, it is dead and doesn't make it to the executable.

> Though hopefully "unreachable" warnings/errors would occur before that point.

It does if warnings are enabled (-w switch).

--
July 05, 2020
https://issues.dlang.org/show_bug.cgi?id=20990

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright created dlang/dmd pull request #11374 "fix Issue 20990 - Optimizer should move cold branches to the end of t…" fixing this issue:

- fix Issue 20990 - Optimizer should move cold branches to the end of the function

https://github.com/dlang/dmd/pull/11374

--
July 06, 2020
https://issues.dlang.org/show_bug.cgi?id=20990

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #11374 "fix Issue 20990 - Optimizer should move cold branches to the end of t…" was merged into master:

- f1b5b1d676b4385b7790bbb0d4a316dd3cc2f92e by Walter Bright:
  fix Issue 20990 - Optimizer should move cold branches to the end of the
function

https://github.com/dlang/dmd/pull/11374

--