为什么llvm被认为不适合实施JIT? [英] Why is llvm considered unsuitable for implementing a JIT?

查看:498
本文介绍了为什么llvm被认为不适合实施JIT?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

许多动态语言实现(或希望实现)JIT编译器,以加快其执行时间.不可避免地,花生画廊的一个人问为什么他们不使用LLVM.答案通常是:"LLVM不适合构建JIT." (例如,阿明·里戈(Armin Rigo)的评论此处.)

Many dynamic languages implement (or want to implement) a JIT Compiler in order to speed up their execution times. Inevitably, someone from the peanut gallery asks why they don't use LLVM. The answer is often, "LLVM is unsuitable for building a JIT." (For Example, Armin Rigo's comment here.)

为什么LLVM不适合构建JIT?

注意:我知道LLVM有自己的JIT.如果LLVM以前不合适,但现在适合,请说说更改了什么.我不是在谈论在LLVM JIT上运行LLVM字节码,而是在谈论使用LLVM库为动态语言实现JIT.

Note: I know LLVM has its own JIT. If LLVM used to be unsuitable, but now is suitable, please say what changed. I'm not talking about running LLVM Bytecode on the LLVM JIT, I'm talking about using the LLVM libraries to implement a JIT for a dynamic language.

推荐答案

Unladen Swallow验尸博客文章中有一些有关LLVM的说明: http://qinsb.blogspot.com/2011/03/unladen-swallow -retrospective.html .

There are some notes about LLVM in the Unladen Swallow post-mortem blog post: http://qinsb.blogspot.com/2011/03/unladen-swallow-retrospective.html .

不幸的是,当前状态下的LLVM实际上被设计为静态编译器优化器和后端. LLVM代码生成和优化是好的,但是很昂贵.所有优化均设计为可在由类似于静态C的语言生成的IR上工作.用于优化Python的大多数重要优化都需要对程序在以前的迭代中如何执行的高级了解,而LLVM并不能帮助我们做到这一点.

Unfortunately, LLVM in its current state is really designed as a static compiler optimizer and back end. LLVM code generation and optimization is good but expensive. The optimizations are all designed to work on IR generated by static C-like languages. Most of the important optimizations for optimizing Python require high-level knowledge of how the program executed on previous iterations, and LLVM didn't help us do that.

这篇关于为什么llvm被认为不适合实施JIT?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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