Detect labels as values C extension to enable threaded code interpretation#13239
Detect labels as values C extension to enable threaded code interpretation#13239nojb merged 1 commit intoocaml:trunkfrom
Conversation
|
Very nice!
I thought inline assembly was not supported for x64; is that not the case? |
d220d53 to
b734e36
Compare
|
I've just force-pushed a little documentation update.
I spoke too fast, you're right. It's only supported for x86. Since we're not supporting native compilation on x86, this could be a win for OCaml on MSVC 32 bits, but it's tricky and I'd rather leave that for another hacking spree. I'm also reading that using inline assembly in a function disables the optimizer on that function. I see no other escape hatch for MSVC. |
|
I'm ready to merge this on @dustanddreams's behalf. @MisterDA can you update the Changes entry? Thanks! |
LLVM and thus clang-cl have had support for labels as values (also called computed gotos) since 2.6~2.7 (released around 2010). All LLVM-based compilers thus support this extension too. Add a test in the configure script for this extension. This makes ocamlc blazingly faster. https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
b734e36 to
193b410
Compare
Done! |
nojb
left a comment
There was a problem hiding this comment.
LGTM (on behalf of @dustanddreams)
LLVM and thus clang-cl have had support for labels as values (also called computed gotos) since 2.6~2.7 (released around 2010). All LLVM-based compilers thus support this extension too. Add a test in the configure script for this extension.
This makes ocamlc build with clang-cl blazingly faster! In GitHub Actions, I see that OCaml build time is cut by 1 to 2 minutes, and the full testsuite execution time by 3 to 4 minutes.
It could be possible to achieve similar gains with MSVC using inline assembly gotos.