llvm-diff.rst 1.6 KB

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