/branch-predictor

Branch Prediction Pin tool, implementing 2-bit saturating counter and perceptron branch predictors.

Primary LanguageC++MIT LicenseMIT

Branch Prediction Pin Tool

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.

Implemented algorithms

This tool provides two ready-to-use implementations of branch predictors:

  1. Two-bit saturating counter branch predictor
  2. Perceptron branch predictor (link)

Additional branch predictors can be implemented by inheriting from the Predictor abstract class.

Running

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