Skip to content

Instantly share code, notes, and snippets.

@Emoun
Emoun / machine-module-pass-story.md
Last active April 7, 2021 09:15
The story of LLVM's MachineModulePass

The story of LLVM's MachineModulePass (from the perspective of T-CREST)

The idea of MachineModulePass is simple: Where ModulePass is a pass over whole modules of LLVM-IR (IR) functions, MachineModulePass would be a pass over whole modules of Machine-IR (MIR) functions.

Back in 2013, when the T-CREST project needed to implement passes over MIR, LLVM didn't have a good way of doing so. Therefore, MachineModulePass was added to the T-CREST LLVM port to facilitate the needed functionality.[1] I'm guessing the hope was that LLVM would eventually provide a version of MachineModulePass that could be used by T-CREST. However, this never happened.