This project is a LLVM pass that performs dead code elimination based on the results of a range analysis implemented by Victor Campos (https://github.com/vhscampos/range-analysis). It was made in LLVM 6.0.0
Before use it, download and install LLVM.
To compile the pass:
- unpack the directory in /llvm/lib/Transforms
- edit the file /llvm/lib/Transforms/CMakeLists.txt: add the line add_subdirectory(Dead-Code-Elimination-with-Range-Analysis)
- goto /llvm/build directory
- type
make RangeAnalysis
(or just typemake
to compile the entire LLVM)
To execute the pass:
- execute the script dead_code_elimination_with_RA.sh
- you must change the command line flags, CLANG, OPT and RANGE_LIB according with your path llvm configuration
*if you are running on Mac OS, the extension of the shared library will be .dylib instead .so