LLVM-DIFF(1)
π llvm-diff β the LLVM structural 'diff', bestie edition
okay so real talk, this is llvm-diff, part of the LLVM fam β¨ (that's the manual name, in case you were wondering, and yes she's from the LLVM project π)
β¨ SYNOPSIS β¨
llvm-diff [options] module 1 module 2 [global name β¦]
π DESCRIPTION π
llvm-diff compares the structure of two LLVM modules, and it's lowkey obsessed with differences in function definitions. Like, that's her main character energy. π
Insignificant differences β things like the ordering of globals changing, or local values getting renamed β are literally ignored. She does not care. Not the vibe. π
Here's the tea on how your input module gets read: if its name ends in .ll, it's interpreted as an assembly file; otherwise it's read in as a bitcode file. No cap. π¦
If you hand her a list of global names, then just the values with those names get compared, periodt. Otherwise, all global values are compared, and she'll produce diagnostics for globals that only show up in one module or the other. π
Now the algorithm, and honestly it's giving "very thorough but kind of dramatic": llvm-diff compares 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're ignored. β
heads up bestie: this algorithm is very sensitive to changes in control flow, and those changes tend to stop any downstream changes from being detected. so a tiny branch tweak can make her miss everything after it π
llvm-diff is intended as a debugging tool for writers of LLVM passes and frontends π§ β she's a dev tool, okay? She does not have a stable output format. Do not build your whole toolchain on her output. Please. π«Ά
π EXIT STATUS π
- If
llvm-difffinds no differences between the modules, she exits with0and produces no output. Clean, quiet, iconic. β¨ - Otherwise she exits with a non-zero value. π
π BUGS π
okay so the part where she's not perfect:
- Many important differences β like changes in linkage or function attributes β are not diagnosed. She just doesn't see them, and that's on periodt. π
- Changes in memory behavior (for example, coalescing loads) can cause massive detected differences in blocks. Like, wildly disproportionate drama. π₯
π AUTHOR π
Maintained by the LLVM Team (https://llvm.org/). π«Ά
π COPYRIGHT π
2003-2023, LLVM Project
and that's the whole page, bestie! π this was page 15, dated 2023-07-14, from LLVM-DIFF(1) β ily, go diff some modules responsibly β¨ππ¦
π¦ where this page comes from
- ubuntu jammy: llvm-15 1:15.0.7-0ubuntu0.22.04.3 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms