This LLVM tutorial is to help you get familiar with LLVM. :)
It consists of 8 practices and 1 toy project in total.
-
List of Practices
- Basic
- (1) First Compilation
- (2) Control Flow Graph
- Optimization
- Analysis
- (3) Function Name Printer
- (4) Instruction Counter
- (5) Call Instruction Counter
- (6) Loop Info
- Transformation
- (7) Insert inc Function
- (8) Dynamic Call Counter
- Analysis
- Basic
-
List of Toy Projects
- Optimization
- MemoryProfiler
- Optimization
For your convenience, I wrote a Makefile that automatically downloads and builds LLVM 10.0.0.
It can take more than 3 hours to build LLVM, please start early!
In each practice folder, type
$ makeYou will get the library file that contains your pass.
In each practice folder, type
$ make testYou will get the optimized IR code (test.opt.ll) for the test program.
In each practice folder, type
$ make runYou will get the output of the optimized program.
If you need a solution for the practices, please contact me.
Seonyeong Heo, heosy@postech.ac.kr