In LLVM, the IR code is run through a pipeline of passes. Each pass performs a single task, such as…