[Patch] x86 JccMovJmpMov2MovSetcc improvement
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:
This patch makes some changes to the JccMovJmpMov2MovSetcc optimisation on i386 and x86-64 platforms to improve code generation:
- Moved from pass 2 to pass 1.
- Now favours "SETcc / MOVZX"
Steps to reproduce:
Apply patch and confirm correct compilation and improved code generation in RTL, for example.
Additional information:
The change to move from pass 2 to pass 1 was made after it was noticed that "SETcc/TESTCmp/Jcc -> Jcc" missed combinations where the SETcc instruction was created in Pass 2; simply moving the SETcc optimisations into pass 2 caused them to perform worse for some reason. Running it in both pass 1 and pass 2 worked, but is a little questionable, plus this change addresses the problem more directly by moving the errant optimisation to pass 1, which also permits it to find more occurrances (again, for reasons uncertain).
Mantis conversion info:
- Mantis ID: 38761
- OS: Microsoft Windows
- OS Build: 10 Home
- Build: r49207
- Platform: i386 and x86_64
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 49402 (#bae58311)