LLVM and the future of optimization

后端 未结 7 1854
被撕碎了的回忆
被撕碎了的回忆 2021-02-19 07:11

I realize that LLVM has a long way to go, but theoretically, can the optimizations that are in GCC/ICC/etc. for individual languages be applied to LLVM byte code? If so, does t

7条回答
  •  南旧
    南旧 (楼主)
    2021-02-19 07:43

    LLVM has made a far way to be a promising alternative to GCC (it even succeeds in compiling the Linux kernel, with some patches). It is also in many cases faster than GCC (the compiler and the generated executables) and has a structure which makes it quite easy to write frontends for arbitrary languages.

    But to allow extensive optimizations also the frontend is equally important since it knows much more details about the program being compiled. Things the LLVM stack cannot easily find out. Therefore to generate efficient programs also the frontend has to optimize the code.

提交回复
热议问题