> without ever needing a single GNU tool besides git[5]
Since when is git GNU?
Re:Vcc – The Vulkan Clang Compiler
by delta_p_delta_x on Thursday January 11, 2024 @06:41AM
(#38950935)
My bad—I meant GPL.
Re:Vcc – The Vulkan Clang Compiler
by SubjectToChange on Wednesday January 10, 2024 @02:58PM
(#38942385)
Written in C++ from the ground up, with a modular, first-class SSA IR-based interface.
LLVM IR is a great accomplishment, but the design of Clang causes tremendous pain. In particular, the lack of any higher level IR(s) in Clang result in tremendous complexity, poorer diagnostics, and missed performance optimizations. Moreover, while initiatives like ClangIR[1] may exist, the fact is that a transition to MLIR will be long and messy, to say the least. Indeed, such a transition would likely involve the complete duplication of Clang internals while downstream implementations migrate. In comparison an implementation like GCC is free to define and modify new IRs as needed, e.g. GIMPLE has three major forms IIRC.
To answer your other question—why LLVM instead of GCC:
- First-class support for non-Unix/Linux platforms. LLVM can be built on Windows and Visual Studio without ever needing a single GNU tool besides git[5]. Clang even has a MSVC-compatible interface that allows MSVC developers to switch to Clang without needing to change their command-line invocation[6].
- Written in C++ from the ground up, with a modular, first-class SSA IR-based interface.
- Permissive Apache 2.0 licence. As much as this might exasperate the open-source community, it allows for significantly faster iteration; things tend to be upstreamed when private/corporate developers realise it is hard to maintain separate forks.
All this allows LLVM to have a pretty mature infrastructure; some very large companies have contributed to its development.
[1]: https://github.com/microsoft/DirectXShaderCompiler
[2]: https://clang.llvm.org/docs/HLSL/HLSLDocs.html
[3]: https://github.com/microsoft/DirectXShaderCompiler/wiki/Cont...
[4]: https://discourse.llvm.org/t/rfc-adding-hlsl-and-directx-sup...
[5]: https://llvm.org/docs/GettingStartedVS.html
[6]: https://clang.llvm.org/docs/UsersManual.html#clang-cl