Skip to content

Few interesting LLVM passes for compiler optimizations

License

Notifications You must be signed in to change notification settings

prateekroy/LLVMPass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

llvm-pass-skeleton

Prerequisite - Follow https://www.cs.cornell.edu/~asampson/blog/llvm.html to write a basic pass.

This repo has three parts :

- Print out the number of memory access instructions, branch instructions, and arithmetic instructions, in each function in the source code. 
- Loop identification and analyse loop nests.
- Identifying dependence between loop variables in a nested loop, interchanging loop nests which are independent of each other. 

Build:

$ cd llvm-pass-skeleton
$ mkdir build
$ cd build
$ cmake ..
$ make
$ cd ..

Run:

$ clang -Xclang -load -Xclang build/skeleton/libSkeletonPass.* something.c