问题描述
我正在学习编程LLVM后端。
I am learning programming LLVM backends.
目前我对分析通道,后期程序转换感兴趣。 (我假设我将更流利的分析,然后将是时间的程序转换)。
Currently I am interested in analysis passes, later program transformations. (I assume as I will be more fluent with analysis then will be time for program transformations).
你能推荐学习资源吗? (我知道LLVM程序员手册和龙书;))。
Could you recommend resources for learning ? (I know LLVM Programmers manual and Dragon Book ;) ).
根据资源,我的意思不仅是教程,书籍,而是特别是精心编写的小项目。我想阅读代码示例,编译它们并与他们一起玩(一点点)以了解更多实际实现。
By resources I mean not only tutorials, books, but especially small well-written projects. I'd like to read code examples, compile them and play with them (hack a little bit) to learn more about practical implementation.
这些代码不必限于分析部分。
Those codes does not have to be restricted to analysis part. The topic is LLVM backend programming in general, while analysis and program transformations are most interesting.
推荐答案
所有LLVM转换都是自组织的包含lib / Transforms dir中的通行,你可以读取它的源代码,并使用 opt
工具对你的代码运行任意传递。
All LLVM transformations are organized as self-contained passes inside lib/Transforms dir, You can read its sources and run any arbitrary pass on your code using opt
tool.
此外,有一个很好的教程,如何编写自己的传递和使用它作为可装载模块,无需重新编译整个LLVM。
Also, there is nice tutorial on how to write your own pass and use it as loadable module without recompiling whole LLVM.
。
这篇关于学习LLVM后端编程的代码示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!