This project implements a custom LLVM compiler pass that performs loop unrolling optimizations at the Intermediate Representation (IR) level. The pass is built using LLVM's new PassManager infrastructure.
- Identifies and unrolls simple loops in LLVM IR.
- Designed for experimentation and learning about compiler optimizations.
- Cleanly integrates with LLVM as a dynamically loadable pass.
LoopUnrollPassProject/
βββ CMakeLists.txt # Build configuration using CMake
βββ LoopUnrollPass.cpp # Custom LLVM pass implementation
- LLVM and Clang installed (LLVM 12 or later recommended)
- CMake 3.10 or newer
- A C++ compiler (e.g.,
clang++org++)
git clone https://github.com/your-username/LoopUnrollPass.git
cd LoopUnrollPass
mkdir build
cd build
cmake ..
makeThis will build the LoopUnrollPass as a shared object (.so or .dylib).
You can apply the pass to an LLVM IR file:
opt -load-pass-plugin ./LoopUnrollPass.so -passes=loop-unroll -disable-output < input.llNote: Make sure the LLVM tools like
optandclangare in yourPATH.
Damin Risho J V