[Patch / Refactor] Nothing (NOP) node optimisation
Original Reporter info from Mantis: CuriousKit @CuriousKit
-
Reporter name: J. Gareth Moreton
Original Reporter info from Mantis: CuriousKit @CuriousKit
- Reporter name: J. Gareth Moreton
Description:
With thanks to #38156 (closed), I was able to develop this patch that aims to improve TBlockNode.simplify by removing statements that contain "nothing" nodes, and merging blocks together when possible.
Besides removing the node tree of clutter (as confirmed when the compiler is built with DEBUG_NODE_XML), it aims to speed up compilation slightly by removing the number of nodes that have to be processed by the second pass as well as potentially allowing for additional node-level optimisations in the future.
Generated binaries should not change - differences in the final binaries are indictive of a bug or oversight.
Steps to reproduce:
Apply patch and comfirm identical generated binaries but cleaner node trees and possible speed boost.
Additional information:
When assembler files are preserved, labels may get renamed if block nodes get merged. Though this shows up as a difference when compared side-by-side with the trunk, the output binary is still identical.
Mantis conversion info:
- Mantis ID: 38194
- OS: Microsoft Windows
- OS Build: 10 Home
- Build: r47737
- Platform: Cross-platform
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 49054 (#c2ff85ac)