简体   繁体   English

LLVM,GCC 4.2和Apple LLVM编译器3.1之间的区别

[英]Difference between LLVM, GCC 4.2 and Apple LLVM compiler 3.1

What are the major differences between LLVM GCC 4.2 and Apple LLVM compiler 3.1? LLVM GCC 4.2和Apple LLVM编译器3.1之间的主要区别是什么?

I'm fairly new to compilers so any help is appreciated. 我对编译器很新,所以任何帮助都表示赞赏。 Also I'm especially interested in how the two compilers could affect game performance. 此外,我对这两个编译器如何影响游戏性能特别感兴趣。

The difference is a matter of both technology and speed. 不同之处在于技术和速度。

CLANG was still young and buggy when Apple began the transition away from GCC's compiler and toolchain, so LLVM was built as a back-end to GCC to facilitate its eventual replacement. 当苹果公司开始从GCC的编译器和工具链过渡时,CLANG仍然年轻且有缺陷,因此LLVM被建立为GCC的后端,以促进其最终的替换。 So, code went in and was compiled by GCC into some intermediate form, but was sent to LLVM to provide the final machine code and packaging. 因此,代码进入并由GCC编译成某种中间形式,但被发送到LLVM以提供最终的机器代码和包装。

Eventually, LLVM and especially CLANG were mature enough to replace GCC outright, which provided an amazing speed boost to compiling and a bump in the quality of the machine code output (though many argue that GCC still produces better quality code at the expense of speed). 最终,LLVM,特别是CLANG已经足够成熟,可以直接取代GCC,这为编译和机器代码输出质量提供了惊人的速度提升(尽管许多人认为GCC仍然以牺牲速度为代价生成质量更好的代码) 。

But to address your concern about game performance: while CLANG may provide a "better" compile experience, performance is not the job of a compiler. 但是要解决您对游戏性能的担忧:虽然CLANG可能提供“更好”的编译体验,但性能不是编译器的工作。 While optimization and simplifications are a part of the compile process, the fact that people still write laggy games or produce infinite loops that lay waste to the stack show that performance is your job. 虽然优化和简化是编译过程的一部分,但人们仍然编写滞后游戏或产生无限循环而浪费到堆栈的事实表明性能是你的工作。 The compiler can only do so much, the rest is up to you. 编译器只能做这么多,其余的由你决定。 The type or vendor of a compiler will also not make or break your game or affect frame rate or usability. 编译器的类型或供应商也不会影响或破坏您的游戏或影响帧速率或可用性。 You should read about lower-level optimizations for the ARM architecture. 您应该阅读有关ARM体系结构的低级优化的信息。 A few articles about NEON , and instruments would do you a lot more good than learning about "optimizing for the compiler". 关于NEON乐器的一些文章比学习“优化编译器”更有益处。

Another Difference: Clang supports most of C++11 . 另一个区别:Clang支持大多数C ++ 11 GCC 4.2-Apple will not support C++11. GCC 4.2-Apple不支持C ++ 11。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM