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