This repository provides a Pin tool that can be used for performing branch prediction studies, i.e., evaluating different branch prediction algorithms. It uses Pin for instrumentation.
This tool provides two ready-to-use implementations of branch predictors:
- Two-bit saturating counter branch predictor
- Perceptron branch predictor (link)
Additional branch predictors can be implemented by inheriting from the Predictor abstract class.
To run, make sure you have Pin installed. You can then compile:
export PIN_ROOT=/path/to/pin
make
and instrument any executable:
sudo pin -t branch-predictor/obj-ia32/branch_predictor.so -- /usr/bin/curl google.com