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