protonscr

Performance: Potentially improve performance with gcc -mcall-ms2sysv-xlogues

protonopen Feature Request
ValveSoftware/Proton#4336 · opened 2020-11-01 by daniel-santos · updated 2020-11-09 · 1 comments · github
Ddaniel-santos 2020-11-01 github

Greetings! I was working on a project in 2016-2017 to improve performance in Wine by out-of-lining the pro- and epilogues required for the ABI compatibility, but became ill and now have very little time for non-paying projects. This patch set is now in gcc, but lacks thorough compatibility testing with wine (and forks).

As such, I request that somebody with the time give it a try and run performance tests. The primary aim is to reduce icache misses, but there are also scenarios where performance is always better when the pro/epilogues are out-of-lined. This option only has binary support at this moment, but the aim was to add an option to enable it always, enable when faster (for the specified -mtune arch), or never enable it.

The feature is disabled for any function marked with ms_hook_prologue. If you care to pay for it, either I or another gcc developer (If I'm not available) would certainly be happy to add the check to the performance tables and enable it only when it is guaranteed to be faster.

Along these lines, there are also other things that can be done to potentially omit the save/restore using flto that (to my knowledge) are not currently implemented; if a given control path can be determined to never clobber one an SSE register (or some of them) or is cloned to become a leaf function where it is never clobbered, then it could be removed for that portion of the LTO call graph. This would be a more time-intensive project, but has the potential to speed things up further, and result less stack space being used (which in turn will reduce dcache misses).

Aaeikum 2020-11-09 github

Thanks for the suggestion. I understand you're not working on it anymore, but when you were, how did you do performance analysis on this? What kind of improvements did you see? Do you know any applications where the improvement would be obvious? Do you know if it it might be dangerous?

Nothing extracted yet.