17c7c75edcdba9fba69e0c30717db8cc6c4fb82b
[libfirm] / TODO
1   * 7.11.2001 Goetz
2     Model Stack frame of a method as class type as for Global type?
3     (Class so that methods defined within methods can be represented?)
4     So far local entities are added to GlobalType.
5
6   * 7.11.2001 Goetz
7     Implement checking whether layout is fixed when setting corresponding
8     flag.  See firmtut, 3.1.4.
9     Maybe write a checker for the type information.
10
11   * 19.6.2001 Goetz
12     What happens if undefined values are allowed?  See ircons.c,
13     grep for get_irg_start_block.
14
15   * 23.5.2001 Goetz
16     Does the array type contain a field with the array entity?
17     This entity should be constructed automatically with the array type.
18
19   * 23.5.2005 Goetz
20     All compound types need a flag saying whether the order of the members
21     must be conserved.
22
23   * 23.5.2001 Goetz
24     Add element_type to array constructor
25
26   * 15.3.2001 Goetz
27     mode, size in type:  Wann gibt es einen mode, wann die size?
28     Kann man den mode aendern?  Nicht bei prim, enum, pointer da
29     schon irreversibel in Programmcode umgesetzt.  Die anderen
30     haben keinen mode.  Reicht daher intern ein Feld?  Muss man
31     in get_type_mode die typen asserten, und set_mode verbieten,
32     dafuer im enum konstruktor mode mitgeben?
33
34   * 14.3.2001 Boris
35     make dist should create an archive which has the directory libfirm/
36     as top-level
37 =======
38   14.3.2001 Boris
39   - make dist should create an archive which has the directory libfirm/
40     as top-level [DONE:28.3.2001 Boris]
41   - Datei 'Copyright' oder 'Copying' mit entsprechendem Copyrightverweis
42
43 *********** old stuff ***********
44
45  * Problem mit endlosen Schleifen loesen.
46
47  * Automatisches generieren und set_value der Argumente-projs in
48    new_ir_graph
49
50  * Define and implement procedure-global extensions, e.g., the call graph.
51
52  * Implement Confirm node: Added by optimization to annotate dataflow
53    edge with information as (value > 0).  This improves dataflow analysis.
54    These nodes can be derived from Cmp nodes in conjunction with dataflow
55    information.
56
57  * think again about implementation of boolean expressions  (0<1) && (2<3)
58
59  * Add evaluation routines for Rotate, Not, Minus, ShrA to target value,
60    extend optimization to cover these nodes.
61
62  * do we need remainder (Rem) operator?
63    different sign handling than Mod.  How much processors???
64
65  * Turn Quot, Minus into three letter operator.
66
67 Propositions by Boris, 5.3.2001:
68  + Fehler in FIRM?
69    ---------------
70    + in oo_program_example ist das Feld einfach nur eine entity. Aber alles andere
71      hat einen bestimmten Typ (z.B. method, strct, etc.). Muß es dann nicht auch
72      field geben? Oder werden alle Felder eines Objekts in einem strct organisiert
73      -> HowTo Use FIRM - Doku.
74      ==> Wann eine entitaet ein Feld ist, laesst sich am Typ der Entitaet enkennen.
75          Entitaet ist Feld wenn Owner Klassentyp (oder ev. Struct) und Typ nicht
76          Methodentyp.
77          Speicherbedarf der Entitaet, d.h. ihr mode, laesst sich auch dem Typ ansehen.
78          Manche Typen enthalten explizit den mode (z.B. type_primitive, type_pointer.)
79          Bei anderen haengt die Groesse vom Layout ab:  class, struct.
80          Frage (fehlende Konvention): Ist eine Klasse ein Pointer oder immer nur
81          eine Value-Class??  Je nach dem muss man die Entitaeten modellieren:
82          Klasse = Pointer:  entitaet kann Typ=class haben.
83          Klasse = WerteKlasse: entitaet sollte pointer mit points-to Klasse sein.
84    - fehlende Optimierung: wenn ein Wert einer Ladeoperation nicht gebraucht wird,
85      dann gibt es auch keine Kante dafuer, aber die Ladeoperation bleibt
86      (unnoetigerweise) stehen.
87    - mit set_optimize(1) geht die Optimierung von if(const cmpop const) unvollständig
88      bzw. falsch [da bleibt wohl ein zweiter Block-Knoten ohne Vorgänger]
89  + Verbesserungsvorschläge:
90    ------------------------
91    + Knoten im Typgraphen mit Farbe hinterlegen
92    - Attribute im Firmgraphen nicht im Knoten
93    + Kanten je nach Sematik farbig markieren, vielleicht dann auch Knoten
94      (z.B. rot fuer alles, was mit Steuerfluss zu tun hat)
95    + konfigurierbar, ob Konstanten im Startblock, oder im aktuellen
96      ==> geht schlecht.
97    + von Hochsprachtypen loesen? Signed32 statt int?
98      ==> viel Arbeit, nur Namenskonvention.  Ev wenn target value modul
99          ausgetauscht.
100
101  + if_while_example ergibt Segmentation Fault da Bad Vorgaenger von Endblock.
102    Optimierung des end blocks geaendert.
103
104  + define Nodes for Rotate, Not, Minus, ShrA.  Extend irdump, verification.
105
106  + change impelmentation of type to use concept as in irnode.
107    Three common fields: kind, ident, mode !!! fill mode with
108    mode_none if applicable.
109
110  + add asserts in type.c that check that proper type is passed.
111    not in get_type_name, get_type_ident.
112
113  + type / entity not good, too much casts.
114    merge type_or_ent union with type union. ??!!
115    allocate always unions.
116    write access routines for type, e.g. get_type_name.
117    change access routines for individual types to select from union.
118
119  + Wann macht man Dispatch Tabellen.  Lower Phase
120
121  + integrate irgmod into ircons.  The routines in there are only needed
122    during ir construction.  (If there are some not needed, remove them.)
123
124  + Build more structured directoriy structure:
125    ir/ir                irgraph, irnode, irop, irmode, type, entity,
126                         common,
127    ir/manipulate        ircons, irgmod, irvrfy
128    ir/optimize          iropt, irflag
129    ir/datastructure     array, obst, pdeq, pset, set
130    ir/include           gmp, host, xfprintf, xgprintf, xmalloc,
131                         xoprintf, xp_help, xprintf
132    ir/compilermodules   ident, xx_ident, tv, ieee754
133    ir/aux               irdump, strerror,
134    where goes           debug, firm, label, mangle, misc, panic, tune?
135
136  + Changes to nodes:
137    - SymConst also returns pointer.
138    - Start returns pointer to segment for globals.
139    - remove copy, clear, type_or_ent
140    - add free
141    - add constructor for shrs
142    - remove Phi0 ruins
143
144  + How shall global variables be modeled in FIRM, if programs as C are
145    translated?  Modeling them as entity of the class defined for the
146    file/compilation unit is not sufficient, as then they are not
147    visible from out of this file.
148    For the uebprakt and kirmes we model them by selection from the
149    area that contains all globals (data segment).  The pointer to
150    this area is provided by the start node.
151    In Sather these were modeled by pointers to string constants containing
152    the name of the global variable (or static field):
153      new_Const (mode_p, tarval_p_from_str ("VAR_A"))
154
155  + port transform_node in iropt to lib.
156
157  + make new Version
158
159 ***************************************************************************
160
161  + add attributes from doku to constructors.
162
163  + add Phi_in stack as field to ir_graph??!!
164
165  + implement ShrA constructor.
166    What are allowed types?
167
168  + add type struct
169
170  + write dumper for type information.
171    write dumper for type and graph.
172    write dumper for control flow graph.
173
174  + dump irgraph with all the type information.  Write function that
175    dumps type information and one that dumps entities.  To integrate
176    this separate dump_node and the recursion, and add the dump_type
177    and dump_entity function in the recursive iterator or write second
178    dump routine.
179
180  + Fix bug in pset/set, so that several tables can be used. iropt/identify
181    aborts. Thanks, Boris!
182
183  + write example program with irreducible control flow:
184
185    /* Phi node with three predecessors: */
186       a = 1
187       if () goto loop
188       a = 2
189       goto loop
190    loop:
191       if () goto exit
192       b = 1
193       goto loop
194    exit:
195       b = a
196
197    /* irreducible two entry loop */
198       b = 1
199       if () goto entry1 else goto entry2
200    entry 1
201       a = 2
202       if () goto exit else goto entry 2
203    entry 2
204       a = 1
205       if () goto exit else goto entry 1
206    exit
207       b = a + b
208
209  + entity must be able to take arrays as owner.  Anything else?
210    --> assert allowed types.
211
212  + Alloc must be able to take any type as owner.  Also primitive types
213    so that allocation to the stack of dereferenced local variables can
214    be modeled.
215
216  + Implement vrfy_graph(end_node) that iterates over the whole graph
217   calling ir_vrfy so that the graph can be verified after each
218    optimization.
219
220  + DONE: Add access routines to ir_graph, ir_mode (?).