README.md 3.27 KB
Newer Older
1
2
libFirm -- A graph based SSA intermediate representation
========================================================
Götz Lindenmaier's avatar
Götz Lindenmaier committed
3

Matthias Braun's avatar
Matthias Braun committed
4
1. Introduction
5
---------------
Götz Lindenmaier's avatar
Götz Lindenmaier committed
6

Andreas Zwinkau's avatar
Andreas Zwinkau committed
7
8
The Firm library implements the Firm intermediate representation (ir).
You can find an old description of Firm in [TLB:99].
Götz Lindenmaier's avatar
Götz Lindenmaier committed
9

Matthias Braun's avatar
Matthias Braun committed
10
libFirm contains algorithms for construction of the SSA form directly from the
yb9976's avatar
yb9976 committed
11
attributed syntax tree. A set of analyses and optimization phases is provided.
Andreas Zwinkau's avatar
Andreas Zwinkau committed
12
13
This version includes a complete backend for the IA32 and SPARC architecture,
as well as unfinished backends for MIPS, ARM, and AMD64.
Matthias Braun's avatar
Matthias Braun committed
14
15

1.1. Features
16
-------------
Matthias Braun's avatar
Matthias Braun committed
17

Luca Barbato's avatar
Luca Barbato committed
18
- works exclusively on a graph based SSA representation up to the code emission.
Matthias Braun's avatar
Matthias Braun committed
19
  Based on the work of C. Click and M. Trapp
Matthias Braun's avatar
Matthias Braun committed
20
21
- written in portable C99. Known to run on gcc on Linux, FreeBSD, Cygwin, clang,
  ICC on windows.
Matthias Braun's avatar
Matthias Braun committed
22
23
24
25
26
- includes doxygen documentation
- support for object oriented type hierarchies
- Analyses: dominance, loop tree, execution frequency, control dependencies,
            inter procedural call graph, rapid type, def-use, alias analysis,
            class hierarchy analysis, ...
yb9976's avatar
yb9976 committed
27
- Optimizations: constant folding, local common subexpression elimination,
Matthias Braun's avatar
Matthias Braun committed
28
29
                 global common subexpression elimination, code placement,
                 operator strength reduction, scalar replacement, load/store,
yb9976's avatar
yb9976 committed
30
                 control flow optimizations, if-conversion, partial condition
Matthias Braun's avatar
Matthias Braun committed
31
                 evaluation, reassociation, tail recursion elimination,
Matthias Braun's avatar
Matthias Braun committed
32
                 inlining, procedure cloning, dead code elimination, ...
Matthias Braun's avatar
Matthias Braun committed
33
34
35
36
37
38
39
40
41
42
- local common subexpression eliminiation, constant folding,
  constant propagatation, arithmetic identities happen implicitely
- extensive checkers
- enhanced debugging support: breakpoints on node creation, entity creation,
            graph dumping, visual studio debug extension
- lowering of intrinsics, double word arithmetics, bitfields
- backend with SSA based register allocation including several algorithms for
  spilling and copy coalescing. Instruction and block scheduling, support for
  ABI handling.
- working ia32 backend with support for x87 and SSE2 floating point
Luca Barbato's avatar
Luca Barbato committed
43
- unfinished backends for SPARC, ARM, AMD64
Matthias Braun's avatar
Matthias Braun committed
44
45
46


2. Building and Installation
47
----------------------------
48

49
Prerequisites for the build:
50

51
* python (2.7.x or >=3.3 are supported)
52
* perl
Matthias Braun's avatar
Matthias Braun committed
53
* an ANSI C99 compiler (gcc, clang, icc are known to work)
Matthias Braun's avatar
Matthias Braun committed
54

55
56
2.1 Build using make
--------------------
Matthias Braun's avatar
Matthias Braun committed
57

58
59
60
61
62
63
64
65
66
67
68
69
Just type 'make' inside libfirms source directory. The results are put into a
directory called "build". You can override the existing preprocessor, compiler
and linker flags by creating a 'config.mak' file.

2.2 Using cmake
---------------

libfirm supports a cmake build system. CMake is a complexer build system than
the makefile based build and most libfirm developers do not use it. However it
can adapt the compiler and linker flags to build shared libraries for a wider
range of systems, provides an installation target and is often more familiar
for people preparing packages for distribution.
Matthias Braun's avatar
Matthias Braun committed
70

71
72
3. Further information and Contact
----------------------------------
73

74
Official website: http://libfirm.org/
75

76
Contact E-Mail: firm@ipd.info.uni-karlsruhe.de
Matthias Braun's avatar
Matthias Braun committed
77

78
Mailing list: https://lists.sourceforge.net/lists/listinfo/libfirm-user
Matthias Braun's avatar
Matthias Braun committed
79

80
Bugtracker: http://pp.ipd.kit.edu/~firm/bugs
81

82
Internet relay chat: irc://chat.freenode.net/#firm