[Windows] Enable tailcall VM on Windows with clang-cl#21619
[Windows] Enable tailcall VM on Windows with clang-cl#21619henderkes wants to merge 5 commits intophp:masterfrom
Conversation
|
@arnaud-lb since this requires the fixes to clang in the first place, perhaps it's better I just mark this PR as ready for review and close the other one? |
|
I would prefer if the other PR was merged first, then this one rebased so it contains only changes related to tailcall VM. |
Probably not in the near term. Moving all dependencies and the Windows build toolchain over to clang is not trivial, and I’d like to first see how far we can get with improved MSVC PGO and possibly |
The dependencies can keep being compiled with MSVC perfectly fine (assuming you mean libraries). Clang has no issue using them. The full snapshot build succeeds for clang, so I think this only affects unbundled extensions from pie/pecl.
Not very far. As for PGO; it generally didn't make a huge difference. I added a frankenphp case for the symfony demo and the uplift was just 10%, still 33% slower than Clang without PGO. It unsurprisingly helped the phpbench case a lot, but that barely improves what I was doing this whole thing for. |
68e7d8a to
aa36e75
Compare
|
@iluuu1994 @arnaud-lb rebased for the current master branch, only left with a small changelist now |
| var vc_ver = probe_binary(PATH_PROG('cl', null)); | ||
| ADD_FLAG("CFLAGS"," -fms-compatibility -fms-compatibility-version=" + vc_ver + " -fms-extensions"); | ||
|
|
||
| if (CLANGVERS >= 1900 && (TARGET_ARCH === 'x64' || TARGET_ARCH === 'arm64')) { |
There was a problem hiding this comment.
I don't have an ARM64 windows pc to test this with, neither does the CI. Should I perhaps limit this to x64 only as a defensive check for now? We only do x64 releases at FrankenPHP anyhow.
I know clang can do tailcalls on arm64, but I'm not sure if the jit changes work for it.
There was a problem hiding this comment.
Maybe @shivammathur is able to test on arm64?
Otherwise it would be fine to limit this to x64 until someone can test.
There was a problem hiding this comment.
Oh yeah, that would be great. Could you add the CI: All variations tag please so that the Clang compilation actually runs?
Perhaps we should also add a test to make sure clang on windows actually produces a php binary with ZEND_VM_KIND = tailcall vm?
There was a problem hiding this comment.
Oh yeah, that would be great. Could you add the CI: All variations tag please so that the Clang compilation actually runs?
Done, you can push again to retrigger CI.
There was a problem hiding this comment.
@henderkes There is a windows-11-arm runner you can use to test this.
requires #21618 first
cc @php/windows-team any chance the official releases will be switched to clang? compiles a bit longer, but performance is improved vastly