Bug 22116 – optimize values based on prior comparisons

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-07-11T18:18:50Z
Last change time
2024-12-13T19:17:34Z
Keywords
backend, performance
Assigned to
No Owner
Creator
Walter Bright
Moved to GitHub: dmd#19960 →

Comments

Comment #0 by bugzilla — 2021-07-11T18:18:50Z
Consider: bool b = (a == 3) ? a : 0; which can be replaced with: bool b = (a == 3); The idea is to do data flow analysis and note that `a` has the value of 3 or !=3 when on a leg of a conditional code path.
Comment #1 by robert.schadek — 2024-12-13T19:17:34Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19960 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB