Patchpoints in LLVM

Hi, just wanted to link this discussion http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-October/066573.html and this piece of docs http://llvm.org/docs/StackMaps.html. As far as I understand, the lack of patchpoints (i.e. a way to patch dynamically generated code) was the major burden on the way to use LLVM for code generation for PyPy. The functionality was implemented as a part of FTL, LLVM-based JavaScript compiler (http://blog.llvm.org/2014/07/ftl-webkits-llvm-based-jit.html) Regards, Dimitri.

Hi Dimitri, On 17 July 2014 15:06, Dimitri Vorona <alendit@googlemail.com> wrote:
As far as I understand, this is not a general way to patch dynamically generated code, but only a way to patch code as some precise point which must be immediately after a call. I don't see how it helps with a tracing JIT, where patching is needed to replace a failing guard (which is indeed a call) with a non-failing optimized piece of code (which no longer calls anything, and which must be compiled from the guard's position and not as a complete function). I may be missing something, of course. I'd however recommend anybody interested in digging more to be aware of http://pypy.readthedocs.org/en/latest/faq.html#could-we-use-llvm (and as far as I'm concerned I'll stick to the position explained here). A bientôt, Armin.

Hi Dimitri, On 17 July 2014 15:06, Dimitri Vorona <alendit@googlemail.com> wrote:
As far as I understand, this is not a general way to patch dynamically generated code, but only a way to patch code as some precise point which must be immediately after a call. I don't see how it helps with a tracing JIT, where patching is needed to replace a failing guard (which is indeed a call) with a non-failing optimized piece of code (which no longer calls anything, and which must be compiled from the guard's position and not as a complete function). I may be missing something, of course. I'd however recommend anybody interested in digging more to be aware of http://pypy.readthedocs.org/en/latest/faq.html#could-we-use-llvm (and as far as I'm concerned I'll stick to the position explained here). A bientôt, Armin.
participants (2)
-
Armin Rigo
-
Dimitri Vorona