LLVM-DIFF(1)

πŸ“¦
version 13.0.1 Β· 5 versions
, in ubuntu jammy

πŸ’… NAME πŸ’…

okay so welcome to the LLVM-DIFF(1) manual page, bestie β€” it's all about llvm-diff, aka the LLVM structural 'diff'. This is your compare-two-LLVM-modules bestie, and it's lowkey a debugging icon. 🫢


✨ SYNOPSIS ✨

llvm-diff [options] module 1 module 2 [global name …]

πŸ¦‹ DESCRIPTION πŸ¦‹

llvm-diff compares the structure of two LLVM modules, and it's mainly focused on differences in function definitions. The insignificant stuff gets ignored, no cap β€” think changes in the ordering of globals, or local values having different names. Not the drama we're looking for. πŸ’…

An input module gets interpreted as an assembly file if its name ends in .ll; otherwise it's read in as a bitcode file.

If you give it a list of global names, then just the values with those names are compared. Otherwise, all global values are compared, and diagnostics are produced for globals which only appear in one module or the other. It's giving "spot the difference," but for LLVM. πŸ‘‘

llvm-diff compares two functions by comparing their basic blocks, beginning with the entry blocks. If the terminators seem to match, then the corresponding successors are compared; otherwise they are ignored.

Vibe check: this algorithm is very sensitive to changes in control flow, which tend to stop any downstream changes from being detected. So control-flow changes are highkey the main character here β€” and not always in a good way. πŸ’€

llvm-diff is intended as a debugging tool for writers of LLVM passes and frontends. It does not have a stable output format β€” so don't go building your whole personality on parsing its output, iykyk.


πŸŽ€ EXIT STATUS πŸŽ€

If llvm-diff finds no differences between the modules, it will exit with 0 and produce no output. Otherwise it will exit with a non-zero value. Clean run? Iconic. Differences found? Not zero, bestie. 😭


πŸ’€ BUGS πŸ’€

  • Many important differences, like changes in linkage or function attributes, are not diagnosed. So don't expect it to catch every single thing β€” it's a whole mood, but not omniscient. πŸ™ˆ
  • Changes in memory behavior (for example, coalescing loads) can cause massive detected differences in blocks. Literally massive. πŸ˜΅β€πŸ’«

πŸ‘‘ AUTHOR πŸ‘‘

Maintained by the LLVM Team (https://llvm.org/). 🫑


2003-2023, LLVM Project


byeee bestie β€” this cutie is LLVM 13, dated 2023-07-14, and the manual is LLVM-DIFF(1). mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from