Bug 171075 - Air should support callsite-saves
Summary: Air should support callsite-saves
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-20 14:12 PDT by Filip Pizlo
Modified: 2017-04-21 11:52 PDT (History)
0 users

See Also:


Attachments
it builds! (31.51 KB, patch)
2017-04-20 14:16 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
full attempt (45.86 KB, patch)
2017-04-21 11:51 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2017-04-20 14:12:45 PDT
Callsite-saves are an optimization that I found to be useful in a previous compiler project.  Basically, if you find that some register file needs callee-saves, but the ABI doesn't give them to you, you can fake it in the compiler: just designate some registers callsite-save and then do:

- Ignore those registers if they appear in the clobber set for any instruction during interference graph building.  Note that if an instruction defs a callsite-save, it still gets interference.

- After register allocation completes, emit save/restore code around any instruction that clobbers but does not def a callsite save.

I previously found this to be a >=30% speed-up on some floating-point code (some raytracer written in Java) on x86-32 when compiling to cdecl, which has no floating point callee-saves.  I used 3 callsite-saves in that project.

It's worth trying at B3 -O2.
Comment 1 Filip Pizlo 2017-04-20 14:16:06 PDT
Created attachment 307636 [details]
it builds!
Comment 2 Filip Pizlo 2017-04-21 11:51:51 PDT
Created attachment 307764 [details]
full attempt

This is neutral on everything except Kraken, where it's a 1% regression.

I guess we don't need it.
Comment 3 Filip Pizlo 2017-04-21 11:52:10 PDT
It's not a progression, so we shouldn't do it.