Skip to content

About

学习LLVM的仓库

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

在LLVM源码外创建一个自己的PASS.

  1. 执行mkdir build
  2. 执行cd build
  3. 执行cmake ../
  4. 执行make即可获取PASS的动态链接库文件。
  5. 测试流程如下:
    1. 执行cd ../tests/
    2. 执行bash test_xxx.sh(该脚本将分别执行:利用clang -emit-llvm生成LLVM IR、利用 opt 优化IR、利用 llvm-as 和 lli 执行,详细请参见脚本源码)
Notes:
  1. funcblockcount十分类似Hello PASS。
  2. reassociate重新关联优化PASS(例如4+(x+5)->x+(4+5))代码源自https://github.com/llvm/llvm-project/blob/release/14.x/llvm/lib/Transforms/Scalar/Reassociate.cpp。
参考链接:

https://zhuanlan.zhihu.com/p/392381317 https://www.jianshu.com/p/9f450969121b https://blog.csdn.net/ZCMUCZX/article/details/80856655 https://llvm.org/docs/CMake.html https://llvm.org/docs/WritingAnLLVMPass.html https://github.com/banach-space/llvm-tutor

About

学习LLVM的仓库

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages