LLVM-DIFF(1)
π LLVM-DIFF(1) β the LLVM structural 'diff', bestie edition
okay so this is llvm-diff, from the LLVM manual set. it's giving "structural diff but make it compiler nerd" and honestly? iconic. let's get into it π¦
β¨ NAME β¨
llvm-diff β LLVM structural 'diff'. that's it, that's the name, no cap π
πΈ SYNOPSIS πΈ
llvm-diff [options] module 1 module 2 [global name ...]
like. two modules. and optionally some global names. slay.
π DESCRIPTION π
okay so llvm-diff compares the structure of two LLVM modules, and it's mostly obsessed with the differences in function definitions. the stuff it does not care about β the insignificant little differences, like changes in the ordering of globals or changes in the names of local values β it literally ignores them. vibe check: passed, moving on π
here's the tea on how it reads your files: an input module gets interpreted as an assembly file if its name ends in .ll. otherwise? it gets read in as a bitcode file. no in-between, that's the rule, periodt.
if you hand it a list of global names, then it only compares the values with those names. if you don't? then all global values get compared, and it produces diagnostics for globals which only appear in one module or the other. so like, it will absolutely call out the globals that showed up alone to the party π
now, how does it compare two functions? by comparing their basic blocks, starting with the entry blocks. if the terminators seem to match, then the corresponding successors get compared; otherwise they are ignored. and bestie, listen β this algorithm is very sensitive to changes in control flow. like, extremely. changes in control flow tend to stop any downstream changes from being detected at all. it's giving "one domino falls and the whole trail goes quiet" π
llvm-diff is intended as a debugging tool for writers of LLVM passes and frontends. and it does not have a stable output format. so don't you dare parse it and expect it to behave, iykyk π
β EXIT STATUS β
if llvm-diff finds no differences between the modules, it will exit with 0 and produce no output. silence. peace. zen π§
otherwise it will exit with a non-zero value. so if you see numbers, something's different fr fr.
π BUGS π
many important differences, like changes in linkage or function attributes, are not diagnosed. yeah. it just won't tell you. tragic.
changes in memory behavior (for example, coalescing loads) can cause massive detected differences in blocks. so you might get a wall of diffs that's technically downstream of one tiny memory thing. it's giving overreaction but make it a compiler π₯
π Author π
maintained by the LLVM Team (https://llvm.org/). the real ones π«Ά
π Copyright π
2003-2026, LLVM Project
and that's the whole page, bestie β LLVM-DIFF(1) from the LLVM manual, page 22, dated 2026-07-16. go forth and diff structurally, mwah πβ¨π
π¦ where this page comes from
- fedora 44: llvm 22.1.8-4.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm 22.1.8-4.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms