Dear All,
I wanted to update my lecture notes about IR modifications. Two years ago, when I have written them, I wanted to have some introductory material into mechanisms Zygote relies on. Now, I have the feeling that its time to expand the notes with CompilerPlugins
, since this seems to be the future.
I have therefore started to look around which provokes some questions.
My first question is, what is the difference between Core.CodeInfo
and Core.Compiler.IRCode
?
Second question. It used to be the case that generated function could return CodeInfo
instead of julia code. Can generated function return IRCode
, or there is a different mechanism how to hook to the compiler (I think yes there is and I expect Diffractor might contain an example).
Third question. IRTools.jl
are great for modifying CodeInfo
. I have found two tools for modifying IRCode
CompilerPluginTools and CodeInfoTools.jl. I wonder if they have been abandoned because they were both dead ends or because of lack of human labor. I am also aware of TKF’s CodeInfo.jl, but I do not think it is designed for manipulation.
I do not have at the moment big aspirations, but I believe making something like Petite Zygote with IRCode
might be a useful educational material.