Added implementatio of overwrites stuff.
[libfirm] / Changes
1   12.1.2001 Goetz
2   Added implementation of overwrites stuff.
3
4   11.7.2001 Goetz
5   Implemented stuff to change the type graph.  See
6   typegmod.h and tpop.h for basic documentation of the change.
7   There now exists a type of kind type_id.  If this appears
8   externally this is a bug.
9
10   9.7.2001 Goetz
11   Added some new access routines to types.
12   List of overwritten fields for entities.
13   Removed a bug in irnode.
14
15   4.7.2001 Goetz
16   Added a routine to set the mangled entity name.
17   Added two routines to copy entites.
18
19   3.7.2001 Goetz
20   Entities now have two more flags, for visibility and allocation mode.
21   Types that have a layout have a flag indicating whether the layout is
22   fixed.
23
24   25.6.2001 Goetz
25   We distinguish three kinds of Cond nodes.  These can be distinguished
26   by the mode of the selector operand and an internal flag of type cond_kind.
27   First we distinguish binary Conds and switch Conds.
28   A binary Cond has as selector a boolean value.  Proj(0) projects the control
29   flow for case "False", Proj(1) the control flow for "True".  A binary Cond
30   is recognized by the boolean selector.
31   The switch Cond has as selector an unsigned integer.  It produces as result
32   an n+1 Tuple (cf0, ... , cfn) of control flows.
33   We differ two flavours of this Cond.  The first, the dense Cond, passes
34   control along output i if the selector value is i, 0 <= i <= n.  If the
35   selector value is >n it passes control along output n.
36   The second Cond flavor differes in the treatment of cases not specified in
37   the source program.  It magically knows about the existence of Proj nodes.
38   It only passes control along output i, 0 <= i <= n, if a node Proj(Cond, i)
39   exists.  Else it passes control along output n (even if this Proj does not
40   exist.)  This Cond we call "fragmentary".  There is a special constructor
41   new_defaultProj that automatically sets the flavor.
42   The two switch flavors are distinguished by a flag of type cond_kind.
43   Default flavor is "dense"
44
45   20.6.2001 Goetz
46   Extended iropt, tv.
47   tv now implements Minus, Abs.
48   iropt now optimizes these and Div, Mod, Quot, DivMod.
49   Still missing: Shrs, Rot.
50   tarval_shr somtimes performs shrs, depending on the compiler/system!!
51   If the ArmRoq implementation is faulty there might appear errors.
52
53   20.6.2001 Goetz
54   Changed ircons: If undefined values are used the Phi construction
55   inserts a constant with value tarval_bad.
56
57   19.6.2001 Goetz
58   Changed array bounds in type.h to ir_node*.  This allows to
59   construct array bounds that are complex constant expressions
60   simpler.  Further dynamic array bounds can be displayed.
61   Comment in ircons.c extended: undefined values in start_block.
62
63   7.6.2001 Goetz
64   ifdef'ed all uses of gmp in tv.c away.  Optimizations for
65   mode_Z no more supported, as well as constants of that mode.
66
67   7.6.2001 Goetz
68   Dokumentation in ir_dump
69   Habe Routinen fuer einzelne Knoten/Kanten aus header entfernt:
70   Benutzen globale Variable die nicht oeffentlich zugaenglich ist.
71
72   28.5.2001 Goetz
73   We need an entity for the array elements for the Sel nodes.  This
74   entity should be stored in the array type.  Changed constructor
75   parameters: include array element type.  Entity for elements is built
76   automatically now.
77
78   28.5.2001 Goetz
79   Removed bug in tv.c.
80   Faulty use of va_arg, became visible with new, stricter gcc 2.96.
81
82   23.5.2001 Goetz
83   Added list of member entites to union.  unioned_types and delimiters
84   are superfluous now -- removed.
85   Rationale: we want to express selection of a union member as a Sel
86   node. for this we need to have entities.  The entities contain the
87   unioned type and have as name the delimiters...
88
89   17.4.2001 Boris
90   Changed Makefile/MakeTargets to install headers and libraries
91   seperately.
92
93   28.3.2001 Boris
94   Changed Makefile and Configure scripts to produce a proper tar file
95   for distribution (libfirm-VERSION.tar)
96   Use 'make distrib' instead of 'make dist'
97
98   14.3.2001 Goetz
99   Changed implementation of tr module.  With this I also changed the
100   interface!!  Type casts are unnecessary now, but some access funcions
101   differ.
102
103
104 ======================================================================
105 ==================== New version: 0.3.0 ==============================
106 ======================================================================
107
108   14.3.2001 Boris
109   added file TODO
110
111   14.3.2001 Boris
112   added creation of a tar archive for distribution
113   replaced ir/.dummy.in by ir/Makefile.in
114
115   13.3.2001 Goetz
116   Changed equivalent_node() and copy_preds() so that the end block
117   is not optimized away if it has no real predecessors.  This fixes
118   the problem with the while examples.
119   Added while_example in Makefile
120
121   12.3.2001 Goetz
122   Fooled around with if_while_example: Why does cse make it abort?
123   Cse removes path to End node, Bad remains as pred of Endblock.
124   The block walker can't deal with this.
125   Made new example with only loop:  while_example.
126
127   12.3.2001 Boris
128   added auto documentation in Makefiles, configure, etc
129   example in ir/ir/ircons.c - much must be added
130   creation of documentation by 'make autodoc' in architecture directory
131
132   5.3.2001 Boris
133   added lots of #ifdef HAVE_CONFIG_G #include "config.h" #endif
134   replaced some C++ style comments (//) by standard C comments /**/
135   added autoconf stuff
136   worked this night:
137         - configure (with some features, see --help for more)
138         - make [depend | tags | install]
139         - make [run] in testprograms
140   did not work:
141         - compilation on SunOS
142         - make dist
143         - automatic call of autoconf if required
144
145   5.3.2001 Goetz
146   More colours in vcg output.
147   Fixed bug:  cse found that start block equals it's
148   first successor as both have the Start block as predecessor.
149   This only happens for local_optimize_graph() as during construction
150   the Start block is not entered in the value table.
151   Changed implementation:  irgmod:  local_optimize_graph() did not
152   empty the hash table with the irnodes for cse.  This might cause that
153   cse turns up with a node that seems better but was removed from the
154   graph in an earlier optimization phase.
155   Removed old #if 1 from ircons.c
156   Commented in call of optimization for Block nodes in irgopt.c, copy_preds():
157   Optimizes blocks that had bad predecessors.
158   Same for Phi nodes.
159
160
161   27.2.2001 Goetz
162   Moved struct from irprog.h to irprog_t.h, same for irmode.h.
163   Added a module deb_info in debug.h.  Adapted makefile.  Added example
164   use in iropt.h.
165   Removed use of debug.h in ident.c. Now debug.c|h can be moved to
166   /adt/.
167   Removed inabled code for dead node elimination in irgopt.h.
168   Renamed some missnamed access routines (_of_).  Macros with old names
169   are in old_fctnames.h.
170   Edited makefiles to remove #* and *.flc.
171
172   ??.2.2001 Goetz
173   Some minor bugfixes...
174
175   25.1.2001 Goetz
176   After compacting of in arrays in dead_node_elimination
177   merge blocks and remove Phis with one pred.
178
179   24.1.2001 Goetz
180   Freeing of obstack in dead_node_elimination commented in.
181   Compacting in arrays of Block and Phi nodes in dead_node_
182   elimination.
183   Some more changes...
184
185   15.01.2001 Goetz
186   added set/get_SymConst_type_or_id in irnode.h
187   added field offset to entity in entity.h
188   added field size to type_class in type.h
189   include "gmp.h" in tv.h with "" instead <>
190
191   12.01.2001 Goetz
192   Some changes to make the lib better portable
193
194   29.12.2000 Goetz
195   Initialize max_node_nr in irprog.
196
197   27.12.2000 Goetz
198   Now outputs warning if faulty type in irdump, dump_type_info.
199   Explicit string termination in irdump, vcg_open.
200
201   20.12.2000 Goetz
202   Added external to declaration of irp.
203   Added typedef before pns and pnc_number.
204   irmode.c, init_mode(): We need to memset all new modes as
205   tarval_vrfy reads fields before they are initialized: It
206   compares to min/max when tarvals for min/max are allocated!
207
208   18.12.2000 Goetz
209   Changed parameter of Methods in type.h and type.c from
210   class to clss.  Class is a C++ keyword.
211
212   10.12.2000 Goetz
213   Changed some testprograms to accomodate Uebprakt.
214
215   7.9.2000 Goetz
216   Finished implementation of dump_all_types.
217   Added new testprogram inheritance_example.
218
219   6.9.2000 Chris
220   Added seven access routines in type.[hc]:
221   get_class_n_member, get_class_n_subtype, get_class_n_supertype,
222   get_strct_n_member, add_strct_member, get_strct_member and set_strct_member.
223   Fixed the type_walk_2 for those seven routines.
224
225   6.9.2000 Goetz
226   Added irdump routine dump_all_types.
227   Did changes to irprog, type, typewalk to achieve this.
228   typewalk needs to walk along members, sub and supertypes, this
229   is still missing!  irdump then needs to output these edges.
230
231 ======================================================================
232 ==================== New version: 0.2.5 ==============================
233 ======================================================================
234
235   3.9.2000 Goetz
236   Made new Version: 0.2.5
237
238   15.8.2000 Goetz until 3.9.00
239   Separated irnode.h and many others into two files: one public
240   one private.
241   Added funcionality to extract headers for lib.
242
243   23.8.2000 Goetz
244   type_dump also dumps irg->ent
245   if_example: corrected nr of locals
246
247   16.8.2000 Goetz
248   irgopt: Correct copy of self pointer in start block.
249   irgopt: Correct treatment of loops: pre function in walker
250     breaks all possible loops in Phi and Block nodes.
251   irr_loop_example: wrong Return statement
252   Now I fixed all but one error: in memory_example.
253   This error showed a conceptual problem, so I wrote
254   a slightly different algorithm.  This now runs for
255   all testprograms.
256   dead_node_example: cse is buggy!! merges start and the
257   following block!
258
259   15.8.2000 Goetz
260   looking at bug in dead_node_elimination.
261   Following fixes:
262   irnode:  all get_..._arr functions changed
263   ircons:  new_r_Block: set matured flag.
264   ircons:  new_r_SymConst: needs mode_p for linkage_ptr_info.
265   adapted call_str_example to new concepts.
266
267   2.8.2000 Goetz
268   Implemented simpler Phi construction algorithm that constructs
269   correct code for three_cfpred_example in ircons.  This algorithm
270   generates more Id nodes than the original algorithm and therefore
271   is less effective.
272   Also made some changes to optimizations of Not.
273
274   31.7.2000 Chris
275   Fixed a bug, caused by the recursive use in type.h and entity.h.
276   Deleted the _TYPE_TYPEDEF_ and inserted the _ENTITY_TYPEDEF_ instead.
277   Fixed a problem in if_while testprogram, so it now works.
278
279   20.7.2000 Goetz
280   Fixed bug in optimize(). Returned Null instead n if
281   get_optimize() == false.
282
283   19.7.2000 Christian
284   Added some access routines in type.[hc]. Solved a recursive definition
285   of type_class struct, entity struct and type union.
286
287   18.7.2000 Goetz
288   Separated entity header into pure functional header and header
289   with data types.
290
291   Goetz
292   ... a bunch small changes not documented
293
294   12.7.2000 Goetz
295   Changed output of oo_prog_example: now uses the internal list
296   of all irgs.  Had to implement some of the access routines for
297   that.  Also fixed a bug in irdump.  Main routines did not use
298   current_ir_graph properly.
299
300   12.7.2000 Goetz
301   Implemented some missing parts in irgopt.
302   Added field irg to entity. Only valid if entity is a method.
303   Had to resove a cyclic de[endency between irgraph.h and entity.h
304   for this.
305   Added fields sub and super to type_class for inheritance.
306   Added field main_irg to irprog.
307
308   7.7.2000 Chris
309   Fixed some bugs in irgopt.c
310   Added some missing 'get_new_node' methods, so the new obstack contains
311   the correct nodes.
312
313   6.7.2000 Chris
314   Renamed ir_vrfy to irn_vrfy and vrfy_graphg to irg_vrfy.
315   Solved some copy'n'paste problems. Deleted most debug-code!
316   Added comments to several files.
317
318   6.7.2000 Goetz
319   Fixed bug in _r_ constructors for all four Div operations.
320   Fixed bug in turn_into_tuple: didn't remember the block.
321   Tested transform_node.
322
323   5.7.2000 Goetz
324   Fixed some testprograms to new semantics of firm.
325   Added testprogram global_var_example.
326   Fixed a bug in irop:  Size of Sel node was (entity *) instead of
327   sel_attr.  Therefor array_heap_example aborted.
328   Also found a missing break in typewalk, case iro_Alloc.
329   Added a construct that unifies all things constructed by the lib
330   and needed to represent a program:  irprog.ch
331   This contains a list of all types as well as a list of all ir graphs.
332   I added calls to initialization and constructors so that this is constructed
333   automatically.  I changed firm.c, type.c, irgraph.c and ev. more.
334   Removed strange block struct and constructor from ircons.c.
335   Moved routines for automatic Phi construction from irgmod to ircons.
336   Sorted functions in ircons to reflect the different interfaces.
337   Renamed dataseg to globals to be conformant with documentation.
338   Added conservation of current_ir_graph to irgopt.c.
339   Corrected bug in Makefiles: wrong path to directory ./inlude.
340
341   4.7.2000 Goetz
342   Commented a whole bunch of stuff, e.g. in ircons.h  (Procedure to construct)
343   We should change the naming of the Block constructor.
344   Removed acces routines to attr. "closed" of Block.
345   Removed second implementation of new_ir_node from ircons and some comments
346   concerned with the now resolved cyclic dependency.
347   Fixed some bugs in irgopt so that the compilation goes through.
348
349   29.6.2000 Chris
350   Changed the irnode attribut 'visit' into 'visited'.
351   Added some access functions, like get/set_irn_visit etc.
352
353   28.6.2000 Chris
354   Renamed some access funtion in irgraph.*.
355   Deleted two global flags (ir_visited and block_visited) from irgraph.*.
356   Added two attributes to the irgraph struct. The visited flags belongs
357   to a ir graph, not to a whole program.
358
359   26.6.2000 Chris
360   A new optimization has been finished. The dead-node-elimination copies
361   the existing ir graph from one opstack to another. While walking the
362   graph, only the reachable nodes will be copied, so the "dead-nodes"
363   (unreachable in the controlflow) are removed.
364
365   19.6.2000 Chris
366   Solved some problems in the 'copy_node' function. The in array was not
367   as easy as it seamed.
368
369   16.6.2000 Chris
370   Wrote a new 'post' funtion, for future use in 'dead-node-elimination'
371   optimization, which is needed in the paramter list of 'irg_walk'.
372
373   14.6.2000 Chris
374   Moved 'optimze_in_place_wrapper' from iropt.* tothe new files irgopt.*.
375   New functions 'local_optimze_graph' and 'dead_node_elimination' are added,
376   but not finished.
377
378   31.5.2000 Chris
379   Removed some files from the archive, after dependencies and usage are
380   checked:
381   - 'ir/common/strerror.c'
382   was nowhere used;
383   - 'ir/ident/xx_ident.h'
384   an empty file, only included by 'ident.c', but never used;
385   - 'ir/tv/label.c' and
386   - 'ir/tv/label.h'
387   contained a numeric counter;
388   The files were included in 'tv.h' and implemented in 'tarval.c'. The two
389   functions 'tarval_label' and 'tarval_forall_labeled' were also never used.
390   In the old fiasco compiler, the label thing is used in the backend.
391   Search for 'babil' to see the usage.
392   Also removed the two attributes 'lab' and 'used' in the tarval struct.
393
394   26.5.2000 Chris
395   Moved the 'new_ir_node' constructor from ircons.* to irnode.* and fixed
396   afterwards some recursive includes, so libfirm works again.
397
398   2+3.2000 Goetz
399   Did a lot of changes, which I never commented until now (4.7.00).
400
401   * Added new result to Start node: Pointer to global data segment.
402   * Extended Semantics of SymConst node to represent information for the
403     linker.
404   * Added arithmeitc nodes (Shrs, Minus ...)
405
406   Rearranged the directory structure and adjusted the makefiles.
407   The directories contain:
408   ir:       everything for the intermediate representation (better: src?)
409     /ir:    the ir itself, and standard optimizations.
410     /tv:    the target value module
411     /tr:    the type and entity representation
412     /adt:   abstract data types
413     /common:  stuff needed by all other dirs
414     /debug: debugging Unterstuetzung
415     /ident:
416   include:  external files needen as includes
417   testprograms: examples to test the lib.
418
419   The makefiles generate files with extension .d that contain the dependencies
420   between the files.
421
422   15.2.2000 Goetz
423   Added access routine to attribute link of irnode in irnode.ch.
424   Added get_negated_pnc to irnode.ch.
425
426   14.2.2000 Goetz
427   Added an iterator in iropt that calls the optimization for all nodes.
428   Copied optimize's code to optimize_in_place and removed deallocations.
429   Made set_irn_n in irnode.c public.
430   Added Bad as possible cfg predecessor in is_cfg_node in irnode.  Bads
431   are allowded as cfgpredecessors to represent dead "incoming" control
432   flow.
433   Added call to optimize_in_place in mature_block. Is this useful?
434
435   10.2.2000 Goetz
436   Changed tests from comparing enums to comparing pointers. This is more
437   efficient (is it?) and reads better.  e.g., instead get_irn_opcode == irm_And
438   now get_irn_op == op_And
439
440   10.2.2000 Goetz
441   Compared equivalent_value to the one in the original fiasco.
442   Added a test in case iro_And.
443   Changed implementation of iro_Div. Added routines turn_into_tuple
444     and set_irn_op() in irgmod/irnode.
445   Changed implementation of irn_Minus (although commented out).
446   Now all features are ported or documented for this function.
447
448   10.2.2000 Goetz
449   Compared computed_value to the one in the original fiasco.
450   Added one further optimization in case iro_Proj.
451   Now all features are ported for this function.
452
453   9.2.2000 Goetz
454   Updated comments in ircons.h.
455
456   9.2.2000 Goetz
457   Changed possible attribute of SymConst from type_class to type.
458   SymConst size could be the size of a union, array, ...
459
460   9.2.2000 Goetz
461   Implemented two dumpers that dump type information and a graph with
462   type information.
463
464   9.2.2000 Goetz
465   Implemented a walker that walks over the type informatin that can
466   be reached from an ir node.
467   Added routine get_kind(firm_thing) in common.h, Added file common.c.
468   Added files typewalk.ch and routines to irdump.
469   Added visited flags and initialization to entity and all types.
470   Implemented some of the missing access routines in type.c, entity.c
471
472   9.2.2000 Goetz
473   Implemented constructor for ShrA.
474   Added type struct.
475   Added routine that iterates the graph and verifies all nodes.
476   Added Phi_in stack to irgraph.  This allows to build several
477     graphs at once with respect to the Phi building algorithm.
478
479   9.2.2000 Goetz
480   Implemented dumper for control flow graphs.  Changed irr_* and dead_*
481   examples to dump cfg.
482
483   8.2.2000 Goetz
484   Implemeted explicit stack for the Phi node generation.  See ircons.c.
485
486   8.2.2000 Goetz
487   added include string.h in xoprintf.c to get rid of warning:
488   implicit declaration of function `bcopy'
489
490   7.2.2000 Goetz
491   Worked on iropt.c:
492   Added more cases to equivalent_node.
493   Portet gigo, identify, identify_remember.
494   The set/pset library can not handle several hash tables.  At least,
495   compiling several procedures causes a segmentation fault during access
496   to the tables (oo_program_example).  Need to work on this.
497   transform_node still needs to be ported.
498   some cases in equivalent_node are still missing.
499
500   To get it running I had to remove the call to optimize in the
501   new_Block constructor. It can only be called when the Block is
502   mature.
503
504   7.2.2000 Goetz
505   Introduced a walker that walks only over blocks.  The asserts
506   might be too strict for general graphs, but so far it works.
507   For the walker I introduced an additional flag in the attribute
508   of Blocks, an a global block_visited variable (in irgraph.h).
509   Furhter I modularized dump_ir_node, implemented dump_ir_graph
510   with the existing walker, and added new routines to output a
511   basic block graph.
512   Changed the examples to call the new dump routine.
513
514   7.2.2000 Goetz
515   Added auxiliary routines to ir_node:
516   skip_Proj, skip_Nop, is_Bad ...
517   Changed access routines to use get_irn_n instead of explicit array
518   accesses. Changed get_irn_n to call skip_Id, so that the access routines
519   never will return Id nodes.
520
521   3.2.2000 Goetz
522   Repaired Phi computation, changed new_r_Phi_in.  Added test program to
523   test irregular controlflow.
524
525   2.2.2000 Goetz
526   Updated optimizations computed_value and equivalent_node to new
527   Syntax of FIRM nodes and to use access routines.
528   Added routine skip_Proj in irnode.
529
530   2.2.2000 Boris Boesler
531   Added files irgwalk.c and irgwalk.h. They include a simple function to
532   traverse an ir graph and execute pre and post functions to current node.
533
534   1.2.2000 Goetz
535   Added arrays with parameters and result types to the type informtion
536   of a procedure.  This is needed for the code generation.  Also added
537   the corresponding access routines.
538   Adapted the testprograms.
539
540   1.2.2000 Goetz
541   Found a bug / complication:  the call order
542     get_value   (makes Phi0, put's it into graph_arr)
543     set_value   (overwrites Phi0 in graph_arr)
544     mature_block (upgrades Phi0, puts it again into graph_arr, overwriting
545                   the proper value.)
546   fails.  Added test wether graph_arr is already set in phi_merge.
547
548   Added tons of comments to explain Phi generation -- the stack hack.
549
550
551   27.1.2000 Goetz
552   irdump now outputs the pnc_number for projs of Cmp nodes.
553   Added routine to access the pnc_string.
554
555   27.1.2000 Goetz
556   Added result "dataseg" to Start node, with all it's consequences.
557   We need this for the compiler lab to translate global variables.
558   Now they can be selected from the data segment, and the start
559   node supplies the pointer to this segment.
560   These changes are guarded by preprocessor variable UEBPRAKT in
561   common.h
562   Changed files: common.h, irgraph.ch, irnode.h
563
564   26.1.2000 Goetz
565   Testprograms:
566   removed array_example, added array-heap_example and
567   array-stack_example and adapted makefile.
568   ir_lib:
569   Entity now also allows type_method as owner. This is to model
570   the stack, Sel nodes that select a variable (array) from the
571   stack need an entity that describes what they select.  This
572   entity gets the type of the enclosing procedure as owner.
573
574   24.1.2000 Chris
575   Added future access routines in `irmode.[ch]' as comments,
576     that all attributes in the ir_mode struct can be user-defined.
577   Added access routines in `irgraph.[ch]', for all attributes.
578
579   22.1.2000 Chris
580   Moved verify routines from `irgraph.[ch]' to own files `irvrfy.[ch]'.
581   Added `irvrfy.[ch]' to MAKEFILE
582   Added "inline" before access routines in `irnode.h', that no warnings
583     will appear furthermore.
584   Added three more access routines in `irmode.[ch]':
585         struct tarval *get_min_of_mode (ir_mode *mode);
586         struct tarval *get_max_of_mode (ir_mode *mode);
587         struct tarval *get_null_of_mode (ir_mode *mode);
588
589   21.1.2000 Goetz
590   Adaption of Alloc, Sel and Entity to new types:
591     Changed array_example to use type instead of type_class.
592     Changed entity to allow all types as owner instead of
593       only type_class.  Added routine "assert_legal_owner_of_ent(type* type)".
594     Changed alloc to allow allocating variables of any type instead of
595       only type_class.
596     Adapted all testprograms to avoid warnings.
597
598   removed dtest ... from Makefile, replaced by test.
599
600   20.1.2000 Goetz
601   Added "run" to makefile, added array_example to makefile of testprograms.
602   Corrected testprogram array
603   Changed assert in irvrfy -- Conv.
604   Started Change log.
605   Started TODO log.