These are some llvm passes that I play around with.
The easiest way to try out these passes is actually to simply use the facilities provided by the llvm repo itself.
- Get and build the llvm source code
- Replace
$LLVM_DIR/lib/Transforms/Hello/Hello.cpp
with one of these passes - Rebuild llvm.
- Go to
$LLVM_DIR/build/
- Compile some code with your pass activated using
./bin/clang++ -Xclang -load -Xclang ../lib/LLVMHello.so MyCode.cpp
- That's it!