LLVM-DIFF(1)
π LLVM-DIFF β the manual, but make it make sense
okay so bestie, welcome to llvm-diff from the LLVM manual, section 1 β¨ this is the page for the LLVM structural 'diff' tool and honestly it's giving detective energy π
β¨ NAME β¨
llvm-diff β LLVM structural 'diff' π¦
β¨ SYNOPSIS β¨
llvm-diff [options] module 1 module 2 [global name ...]
β¨ DESCRIPTION β¨
so what does it even do π llvm-diff compares the structure of two LLVM modules, and it's mostly obsessed with differences in function definitions. the whole point is that insignificant differences β like the order globals show up in, or the names of local values β get straight up ignored. not the vibe, not the tea, we don't care π
here's the lore on how your input gets read: an input module is interpreted as an assembly file if its name ends in .ll; otherwise it gets read in as a bitcode file. that's it, that's the whole rule π₯
if you hand it a list of global names, then only the values with those names get compared. no list? then all global values get compared, and you'll get diagnostics for any globals that only show up in one module or the other. main character energy from the globals fr fr π
and now, how it compares two functions: it compares their basic blocks, starting with the entry blocks. if the terminators seem to match, then the corresponding successors get compared; if they don't seem to match, those successors just get ignored, no cap. heads up though β
this algorithm is very sensitive to changes in control flow, which tend to stop any downstream changes from being detected π like one little branch change and the rest of the diff just goes quiet on you
one more thing: llvm-diff is intended as a debugging tool for writers of LLVM passes and frontends. it does not have a stable output format, so please don't parse it, bestie, i'm begging π
β¨ EXIT STATUS β¨
- if
llvm-difffinds no differences between the modules, it exits with0and produces no output πΈ - otherwise it exits with a non-zero value π
β¨ BUGS β¨
okay so the flaws, we're being honest π«Ά
- many important differences are not diagnosed, like changes in linkage or function attributes. yeah. iconic of it, unfortunately.
- changes in memory behavior (for example, coalescing loads) can cause massive detected differences in blocks. like, unhinged amounts. brace yourself π
β¨ AUTHOR β¨
maintained by the LLVM Team (https://llvm.org/) π
β¨ COPYRIGHT β¨
2003-2026, LLVM Project π
okay that's the whole page, bestie, you're basically a diff expert now β
LLVM-DIFF(1) Β· page 21 Β· dated 2026-07-22 Β· brought to you by the LLVM manual, section 1 π¦β¨ periodt π
π¦ where this page comes from
- epel 10: llvm21 21.1.8-8.el10_3 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 43: llvm 21.1.8-6.fc43 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 43: llvm 21.1.8-6.fc43 Β· 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