LLVM-DIFF(1)
π LLVM-DIFF(1) π
okay bestie, welcome to llvm-diff β it lives in the LLVM manual section, and it's literally the structural 'diff' of the LLVM world. no cap. π¦
β¨ NAME β¨
llvm-diff β LLVM structural 'diff' πΈ
π SYNOPSIS π
llvm-diff [options] module 1 module 2 [global name ...]
like. that's the whole vibe. two modules, maybe some names, go off. π
π«Ά DESCRIPTION π«Ά
okay so llvm-diff compares the structure of two LLVM modules, and it's highkey obsessed with differences in function definitions. the thing is, it's not petty β insignificant differences like changes in the ordering of globals or in the names of local values? ignored. not the drama we're here for. π
an input module gets interpreted as an assembly file if its name ends in '.ll'; otherwise it gets read in as a bitcode file. that's the whole rule, no exceptions, periodt. β¨
if you hand it a list of global names, then just the values with those names are compared. otherwise? all global values get compared, and it produces diagnostics for globals that only show up in one module or the other. it's giving thorough. π
here's how it compares two functions, bestie: it compares their basic blocks, beginning with the entry blocks. if the terminators seem to match, then the corresponding successors are compared; otherwise they are ignored. and this algorithm is very sensitive to changes in control flow β like, those tend to stop any downstream changes from being detected. so dramatic. π
real talk: llvm-diff is intended as a debugging tool for writers of LLVM passes and frontends. it does not have a stable output format. do not build your whole pipeline on its output, i am begging. π
β EXIT STATUS β
- if
llvm-difffinds no differences between the modules, it exits with0and produces no output. iconic, silent, mysterious. π§ - otherwise it exits with a non-zero value. it said something, and it meant it. π₯
π BUGS π
- many important differences β like changes in linkage or function attributes β are not diagnosed. yes fr fr, it just doesn't clock them. π
- changes in memory behavior (for example, coalescing loads) can cause massive detected differences in blocks. not a little oopsie. a whole situation. π
π AUTHOR π
maintained by the LLVM Team (https://llvm.org/). they're the main characters here, we're just visiting. π
π COPYRIGHT π
2003-2025, LLVM Project β all the love, all the years, all the legal stuff. π
and that's the tea, bestie π this was LLVM-DIFF(1) from the LLVM manual, version 20, dated 2025-09-03. go compare some modules, slay, and remember: non-zero exit means something's different, and that's on periodt. π¦β¨π
π¦ where this page comes from
- fedora 43: llvm20 20.1.8-2.fc43 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 43: llvm20 20.1.8-2.fc43 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm20 20.1.8-2.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm20 20.1.8-2.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