*** empty log message ***
[libfirm] / TODO
1
2   * Goetz 10.6.04
3     Error in removing dead code:
4     In an if condition is a loop.  We optimized the if condition to Jmp/Bad,
5     the loop now is unreachable.  It should be removed by gigo or the like.
6     It remains in the representation as all blocks in the loop have a
7     valid predecessor, i.e., walking from End we find a true loop.  We need
8     a pass walking and marking starting at the Start node to remove this loop.
9     Currently scc causes an segmetation fault for this situation.
10
11   * Goetz 10.6.04
12     Error in irscc:  If we have an unreachable loop, or a loop
13     resulting from an exiting endless recursion, irscc finds
14     no tail ==> issues an assertion.
15
16   * Goetz 10.6.04
17     Error in interprocedural view:  Endless recursions are lost.
18
19   * print routines for all enums!
20
21   * Add flag whether mode is associative, float modes are not!!
22
23   * 25.2.04 Goetz
24     Fix memory leak in irprog: free_ir_prog.
25     Fix memory leak in entity: free_entity_attrs
26
27   * 19.12.03 Goetz
28     Add state management for loops (consistent, inconsistent, invalid).
29
30   * 18.12.03 Goetz
31     It sucks that Call and CallBegin are different nodes. Change this!!!!
32     (as for Filter: Phi/Proj).
33
34   * 8.12. Goetz
35     Vorgaengernummern am Looptree auf Kanten ausgeben.
36
37   * 8.12.03 Goetz und Till
38     Alloc Semantik:  Der Alloc Knoten koennte wissen, ob der
39     allozierte Speicher zu Null initialisiert ist.  Dies nehmen
40     wir im Jack Java Compiler an, im CRS C Compiler jedoch nicht.
41     Ist das nicht explizit im Allok Knoten vermerkt, kann eine
42     Optimierung nur in Abhaengigkeit vom Frontend darauf aufbauen.
43     (z.B. heapanal nimmt any an, statt null.)
44
45   * 8.9.03 Boris
46     Wenn man in Arrays.java in der Methode ArrObject.f() die
47     ersten zwei prints auskommentiert und pass_array_test die
48     for-Schleife durch ein i = 0, while(true).. ersetzt, stürzt der
49     Compiler in get_Block_idom ab; der übergebene Zeiger ist ein
50     NULL-Zeiger.
51
52   * 15.9.03 Goetz
53     Wir haben ev. einen Fehler in scc gefunden:  Matthias hat eine
54     Enlosrekursion a() { b(); }, b() { a(); } in Java implementiert.
55     Darauf ist in is_head die Assertion
56         assert(get_irn_uplink(pred) >= get_irn_uplink(root));
57     geflogen.
58
59   * 29.8.03 Goetz
60     Cast: irsimpletype: implement type analyses for one node.  Test the
61     effort of that analyses.  Add optimization to iropt that removes
62     Cast nodes.
63
64   * 22.8.2003 Goetz
65     Firm const nodes should have a type.
66     In jack all nodes are typed now, except the Const nodes. Only const from
67     tarval is typed.
68
69   * 14.8.2003 Goetz
70     Diverse dynamische arrays haben ein erstes, unverwendetes element. Z.B.
71     class members.  Entfernen um Speicher zu sparen.
72     Ev. auch attribute an firm Knoten optimieren, per bitfield.
73
74   + 24.3.2003 Goetz
75     tarval requirements:
76     zu register_mode:
77     Ich haette ganz gerne
78       new_ir_mode(ident* name, int size, int alignment, mode_sort sort);
79     modecode ist der naechste frei int > maxenum.
80     Und der konstruktor sollte auch nach den zwei inits aufgerufen werden koennen.
81     was spricht dagegen?  (die zwei inits stehen in init_firm(), ein benutzer kann
82     schwer dazwischen andere methoden aufrufen.)
83
84   * 24.3.2003 Goetz
85     tarval requirements:
86     - if overflow either return no tarval or return result of overflow
87       computation.  Offer to output a warning. (configurable)
88     - Div:  configure rounding (up/down) in init_firm, remark in each Div node
89       rounding sheme, default by initializations, pass rounding sheme
90       to tarval module
91     - impelement tarval_bitpattern
92     - make routine that outputs parts < 32 bits from any tarval
93       at given position in a C type that is exactly 32 bits.
94       For this test C types for their size or use int32 in integer.h
95       (is this standard C??)
96     - add routine that outputs the position of the largest set bit.
97
98   + 29.10.2002 Goetz
99     Representation of value compounds is not good, especially with
100     calls.
101
102   + 29.10.2002 Goetz
103     We can not represent bitfield members of structs in C.
104     Decision: generate explicit code for it, using shifts etc.
105     No special support.
106
107   * 29.10.2002 Goetz
108     If parameter variables are dereferenced they must be represented
109     by an entity in the stack frame type.  We need a mechanism to
110     find out which fields were parameters so that the parameter
111     passing space on the frame can be used for the parameters.
112
113   + 19.11.2001 Goetz
114     SymConst mit ident taugt nicht:  Wenn man z.B. die Prozedur kennt
115     sollte man die entitaet der Prozedur angeben koennen.  Ermoeglicht
116     einfachere Navigation im Callgraphen.
117     --> Verwende Const mit entity.
118
119   + 13.11.2001 Goetz
120     Aufbau Exceptions tut nicht:
121     1) mache exception handle block
122     2) baue code auf, verzweige von fragile ops zu dem Handler
123     3) mature exception block
124     --> Dann werden natuerlich die Werte am Ende der Bloecke mit den
125        fragile ops verwendet!  Diese sind ev. nicht berechnet.  Trifft
126        insbesondere auf memory zu ...
127     Loesung z.B.:
128     immExcBlock konstruktor.  Neuer "mature" status.  immExcBlocks duerfen
129     keine zyklen bilden.  In immExcBlocks werden PhiKnoten sofort eingesetzt,
130     aber wie immBlock mit flexibler vorgaenger liste.  add_in_edge ergaenzt
131     bei allen Phi Knoten dann sofort die neu bekannten Werte.  Jetzt kann
132     genau der Status zum Zeitpunkt der Exception abgebildet werden.
133
134   + 7.11.2001 Goetz
135     Model Stack frame of a method as class type as for Global type?
136     (Class so that methods defined within methods can be represented?)
137     So far local entities are added to GlobalType.
138
139   + 7.11.2001 Goetz
140     Implement support for endless loops.
141     (Add Jump target block to a list if optimizing Cond nodes.
142     Extend walker to start walking at this list.
143     Extend dead node elimination to update and compact this list.
144     Extend inlining to inline this list.)
145
146   + 7.11.2001 Goetz
147     Implement checking whether layout is fixed when setting corresponding
148     flag.  See firmtut, 3.1.4.
149     Maybe write a checker for the type information.
150
151   + 19.6.2001 Goetz
152     What happens if undefined values are allowed?  See ircons.c,
153     grep for get_irg_start_block.
154
155   + 23.5.2001 Goetz
156     Does the array type contain a field with the array entity?
157     This entity should be constructed automatically with the array type.
158
159   * 23.5.2005 Goetz
160     All compound types need a flag saying whether the order of the members
161     must be conserved.
162
163   + 23.5.2001 Goetz
164     Add element_type to array constructor
165
166   + 15.3.2001 Goetz
167     mode, size in type:  Wann gibt es einen mode, wann die size?
168     Kann man den mode aendern?  Nicht bei prim, enum, pointer da
169     schon irreversibel in Programmcode umgesetzt.  Die anderen
170     haben keinen mode.  Reicht daher intern ein Feld?  Muss man
171     in get_type_mode die typen asserten, und set_mode verbieten,
172     dafuer im enum konstruktor mode mitgeben?
173
174   + 14.3.2001 Boris
175     make dist should create an archive which has the directory libfirm/
176     as top-level
177 =======
178   14.3.2001 Boris
179   - make dist should create an archive which has the directory libfirm/
180     as top-level [DONE:28.3.2001 Boris]
181   - Datei 'Copyright' oder 'Copying' mit entsprechendem Copyrightverweis
182
183 *********** old stuff ***********
184
185  + Problem mit endlosen Schleifen loesen.
186
187  * Automatisches generieren und set_value der Argumente-projs in
188    new_ir_graph
189
190  + Define and implement procedure-global extensions, e.g., the call graph.
191
192  * Implement Confirm node: Added by optimization to annotate dataflow
193    edge with information as (value > 0).  This improves dataflow analysis.
194    These nodes can be derived from Cmp nodes in conjunction with dataflow
195    information.
196
197  + think again about implementation of boolean expressions  (0<1) && (2<3)
198    Cast now possible
199
200  + Add evaluation routines for Rotate, Not, Minus, ShrA to target value,
201    extend optimization to cover these nodes.
202
203  * do we need remainder (Rem) operator?
204    different sign handling than Mod.  How much processors???
205
206  * Turn Quot, Minus into three letter operator.
207
208 Propositions by Boris, 5.3.2001:
209  + Fehler in FIRM?
210    ---------------
211    + in oo_program_example ist das Feld einfach nur eine entity. Aber alles andere
212      hat einen bestimmten Typ (z.B. method, strct, etc.). Muß es dann nicht auch
213      field geben? Oder werden alle Felder eines Objekts in einem strct organisiert
214      -> HowTo Use FIRM - Doku.
215      ==> Wann eine entitaet ein Feld ist, laesst sich am Typ der Entitaet enkennen.
216          Entitaet ist Feld wenn Owner Klassentyp (oder ev. Struct) und Typ nicht
217          Methodentyp.
218          Speicherbedarf der Entitaet, d.h. ihr mode, laesst sich auch dem Typ ansehen.
219          Manche Typen enthalten explizit den mode (z.B. type_primitive, type_pointer.)
220          Bei anderen haengt die Groesse vom Layout ab:  class, struct.
221          Frage (fehlende Konvention): Ist eine Klasse ein Pointer oder immer nur
222          eine Value-Class??  Je nach dem muss man die Entitaeten modellieren:
223          Klasse = Pointer:  entitaet kann Typ=class haben.
224          Klasse = WerteKlasse: entitaet sollte pointer mit points-to Klasse sein.
225    - fehlende Optimierung: wenn ein Wert einer Ladeoperation nicht gebraucht wird,
226      dann gibt es auch keine Kante dafuer, aber die Ladeoperation bleibt
227      (unnoetigerweise) stehen.
228    - mit set_optimize(1) geht die Optimierung von if(const cmpop const) unvollständig
229      bzw. falsch [da bleibt wohl ein zweiter Block-Knoten ohne Vorgänger]
230  + Verbesserungsvorschläge:
231    ------------------------
232    + Knoten im Typgraphen mit Farbe hinterlegen
233    - Attribute im Firmgraphen nicht im Knoten
234    + Kanten je nach Sematik farbig markieren, vielleicht dann auch Knoten
235      (z.B. rot fuer alles, was mit Steuerfluss zu tun hat)
236    + konfigurierbar, ob Konstanten im Startblock, oder im aktuellen
237      ==> geht schlecht.
238    + von Hochsprachtypen loesen? Signed32 statt int?
239      ==> viel Arbeit, nur Namenskonvention.  Ev wenn target value modul
240          ausgetauscht.
241
242  + if_while_example ergibt Segmentation Fault da Bad Vorgaenger von Endblock.
243    Optimierung des end blocks geaendert.
244
245  + define Nodes for Rotate, Not, Minus, ShrA.  Extend irdump, verification.
246
247  + change impelmentation of type to use concept as in irnode.
248    Three common fields: kind, ident, mode !!! fill mode with
249    mode_none if applicable.
250
251  + add asserts in type.c that check that proper type is passed.
252    not in get_type_name, get_type_ident.
253
254  + type / entity not good, too much casts.
255    merge type_or_ent union with type union. ??!!
256    allocate always unions.
257    write access routines for type, e.g. get_type_name.
258    change access routines for individual types to select from union.
259
260  + Wann macht man Dispatch Tabellen.  Lower Phase
261
262  + integrate irgmod into ircons.  The routines in there are only needed
263    during ir construction.  (If there are some not needed, remove them.)
264
265  + Build more structured directoriy structure:
266    ir/ir                irgraph, irnode, irop, irmode, type, entity,
267                         common,
268    ir/manipulate        ircons, irgmod, irvrfy
269    ir/optimize          iropt, irflag
270    ir/datastructure     array, obst, pdeq, pset, set
271    ir/include           gmp, host, xfprintf, xgprintf, xmalloc,
272                         xoprintf, xp_help, xprintf
273    ir/compilermodules   ident, xx_ident, tv, ieee754
274    ir/aux               irdump, strerror,
275    where goes           debug, firm, label, mangle, misc, panic, tune?
276
277  + Changes to nodes:
278    - SymConst also returns pointer.
279    - Start returns pointer to segment for globals.
280    - remove copy, clear, type_or_ent
281    - add free
282    - add constructor for shrs
283    - remove Phi0 ruins
284
285  + How shall global variables be modeled in FIRM, if programs as C are
286    translated?  Modeling them as entity of the class defined for the
287    file/compilation unit is not sufficient, as then they are not
288    visible from out of this file.
289    For the uebprakt and kirmes we model them by selection from the
290    area that contains all globals (data segment).  The pointer to
291    this area is provided by the start node.
292    In Sather these were modeled by pointers to string constants containing
293    the name of the global variable (or static field):
294      new_Const (mode_p, tarval_p_from_str ("VAR_A"))
295
296  + port transform_node in iropt to lib.
297
298  + make new Version
299
300 ***************************************************************************
301
302  + add attributes from doku to constructors.
303
304  + add Phi_in stack as field to ir_graph??!!
305
306  + implement ShrA constructor.
307    What are allowed types?
308
309  + add type struct
310
311  + write dumper for type information.
312    write dumper for type and graph.
313    write dumper for control flow graph.
314
315  + dump irgraph with all the type information.  Write function that
316    dumps type information and one that dumps entities.  To integrate
317    this separate dump_node and the recursion, and add the dump_type
318    and dump_entity function in the recursive iterator or write second
319    dump routine.
320
321  + Fix bug in pset/set, so that several tables can be used. iropt/identify
322    aborts. Thanks, Boris!
323
324  + write example program with irreducible control flow:
325
326    /* Phi node with three predecessors: */
327       a = 1
328       if () goto loop
329       a = 2
330       goto loop
331    loop:
332       if () goto exit
333       b = 1
334       goto loop
335    exit:
336       b = a
337
338    /* irreducible two entry loop */
339       b = 1
340       if () goto entry1 else goto entry2
341    entry 1
342       a = 2
343       if () goto exit else goto entry 2
344    entry 2
345       a = 1
346       if () goto exit else goto entry 1
347    exit
348       b = a + b
349
350  + entity must be able to take arrays as owner.  Anything else?
351    --> assert allowed types.
352
353  + Alloc must be able to take any type as owner.  Also primitive types
354    so that allocation to the stack of dereferenced local variables can
355    be modeled.
356
357  + Implement vrfy_graph(end_node) that iterates over the whole graph
358   calling ir_vrfy so that the graph can be verified after each
359    optimization.
360
361  + DONE: Add access routines to ir_graph, ir_mode (?).