Skip to content

Instantly share code, notes, and snippets.

@Emoun
Emoun / risc-v-encoding-use.py
Created September 2, 2025 21:39
Calculates how much of the encoding space RISC-V uses.
import os
import subprocess
import sys
import re
with_debug = False
if len(sys.argv) > 1:
if sys.argv[1] == "debug":
with_debug = True
@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.