LLVM,GCC 4.2和Apple LLVM编译器之间的区别3.1 [英] Difference between LLVM, GCC 4.2 and Apple LLVM compiler 3.1

查看:291
本文介绍了LLVM,GCC 4.2和Apple LLVM编译器之间的区别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.

当苹果开始从GCC的编译器和工具链转移时,CLANG仍然年轻,有bug,所以LLVM被构建为GCC的后端,替代。因此,代码进入并由GCC编译成一些中间形式,但是被发送到LLVM以提供最终的机器代码和包装。

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. 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.

最终,LLVM,特别是CLANG已经足够成熟,可以完全取代GCC,这为编译提供了惊人的速度,并提高了机器代码输出的质量许多人认为GCC仍然以牺牲速度为代价生产质量更好的代码。)

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).

但是为了解决你对游戏性能的关注:虽然CLANG可能提供一个更好的编译体验,性能不是编译器的工作。虽然优化和简化是编译过程的一部分,但是人们仍然编写拖拽游戏或产生浪费堆栈的无限循环的事实表明,性能是你的工作。编译器只能做这么多,其余的取决于你。编译器的类型或供应商也不会制造或破坏游戏或影响帧速率或可用性。您应该阅读有关ARM体系结构的低级优化。有关 NEON 仪器会比学习优化编译器更好。

But to address your concern about game performance: while CLANG may provide a "better" compile experience, performance is not the job of a compiler. 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. A few articles about NEON, and instruments would do you a lot more good than learning about "optimizing for the compiler".

这篇关于LLVM,GCC 4.2和Apple LLVM编译器之间的区别3.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆