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