llvm-diff.rst 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. llvm-diff - LLVM structural 'diff'
  2. ==================================
  3. SYNOPSIS
  4. --------
  5. **llvm-diff** [*options*] *module 1* *module 2* [*global name ...*]
  6. DESCRIPTION
  7. -----------
  8. **llvm-diff** compares the structure of two LLVM modules, primarily
  9. focusing on differences in function definitions. Insignificant
  10. differences, such as changes in the ordering of globals or in the
  11. names of local values, are ignored.
  12. An input module will be interpreted as an assembly file if its name
  13. ends in '.ll'; otherwise it will be read in as a bitcode file.
  14. If a list of global names is given, just the values with those names
  15. are compared; otherwise, all global values are compared, and
  16. diagnostics are produced for globals which only appear in one module
  17. or the other.
  18. **llvm-diff** compares two functions by comparing their basic blocks,
  19. beginning with the entry blocks. If the terminators seem to match,
  20. then the corresponding successors are compared; otherwise they are
  21. ignored. This algorithm is very sensitive to changes in control flow,
  22. which tend to stop any downstream changes from being detected.
  23. **llvm-diff** is intended as a debugging tool for writers of LLVM
  24. passes and frontends. It does not have a stable output format.
  25. EXIT STATUS
  26. -----------
  27. If **llvm-diff** finds no differences between the modules, it will exit
  28. with 0 and produce no output. Otherwise it will exit with a non-zero
  29. value.
  30. BUGS
  31. ----
  32. Many important differences, like changes in linkage or function
  33. attributes, are not diagnosed.
  34. Changes in memory behavior (for example, coalescing loads) can cause
  35. massive detected differences in blocks.