[Windows] allow clang to build tailcall vm, use __preserve_none for Call VM if available with msvc#21563
[Windows] allow clang to build tailcall vm, use __preserve_none for Call VM if available with msvc#21563henderkes wants to merge 2 commits intophp:masterfrom
Conversation
…Call VM if available
8d8808b to
774082c
Compare
|
Okay, got a decent idea how the JIT works now. There seem to be two issues: first, jit ir doesn't use the actual calling convention of the handlers but assumes tailcall vm -> preserve_none, else fastcall ( Second one is easy to fix, first will need touches in various places. Can't just replace it because different registers are getting clobbered and that will destroy fp and ip. Whether this is worth my time pursuing, I'll leave open for the core team to decide. I'm fairly confident that I could fix the issues with a few days of time if it's seen as beneficial. But perhaps not, because maybe Microsoft starts working on their compiler again after leaving it abandoned for half a decade and we better spend the effort on proper tailcall VM then. |
Not the largest improvement (~5-8% in my testing), but msvc's __preserve_none is not stable enough to use the tailcall vm with
[[msvc::musttail]].The tailcall VM for clang is a nice 25-30% improvement, but it still lags far behind msvc.
I'm not 100% sure if switching the call vm to __preserve_none could have any ill effects - Edit: forgot about the JIT... will take a while to track that down. If it's even feasible, I've never looked at the jit code.
PS: removing
/GUARD:CF(fromPHP_SECURITY_FLAGS) gives a 40% performance uplift in phoronix phpbench. I'm guessing disabling that isn't a good idea?