3 Added flag "peculiarity" to entity.h, type.h.
6 Bug: dominator construction aborts for BreakTest with flag 3.31
7 Problem: optimization of many subsequent blocks (Jmp-chains)
8 where one is inlined (Tuple control flow) in a loop. Not all
9 nodes in merged blocks are moved to remaining block.
10 Fix: different calling order to optimize_in_place_2 from
11 optimize_in_place_wrapper.
12 Bug: dumping cfg when a block is Bad. Fix: Output Bad node.
13 Change: not only turn off cse but all optimizations during
17 Parted common.h into two files common_t.h. By this config.h
18 as well as the preprocessor flags are no more visible externaly.
19 Adapted include directives.
22 Bugfix in inlining: problems in combination with cse.
25 Implemented cf optimizations.
26 Checked compiler flags -- sorted better to fit optimizations.
30 Implemented code placement.
34 irdom implemented: dominator information.
37 Bugfix Optmierung Binops mit mode Tupel.
40 irgopt: inline_small_irgs implemented
43 Bugfixes, some access functions ...
46 New directory: ana for analyses. Adapted configure/makefiles
47 implemented irout: backedges. Added one field to ir_graph, one to ir_node.
48 Implemented state management for irgraphs: see irgraph.h.
49 Must now call finalize_cons() after graph construction!!
53 Flag pinned in irop, irgraph.
54 Global cse in irop, setting the irgraph flag.
55 Example programs: Endless_loop.c. global_cse.c.
59 Implemented support for endless loops:
61 Adapted Phi constructors so that memory phis are added.
62 Adapted Cond optimization: add block to End.
63 Adapted dead node elimination: compation of Ends predecessors
64 Adapted inlineing: remember keepalives of inlined graph.
65 Added informative strings to asserts in irvrfy.
68 Added volatile flag to entity, order flag to array.
69 Added a set of assertions.
72 Added access function set_class_members()
75 Asserts in irvrfy that verify the mode of Proj nodes. For Start,
76 Call, Return they check the corresponding function type! Corrected
78 Some asserts for legal values of 'pos' arguments in type/entity
82 Some access routines for visited flags in entity.h, irnode.h,
83 bug in oo_program_example.
86 Removed all obsolete Makefiles
89 Added support for constant entities. A new example program illustrates
90 their use. Extended dumper routines to dump constant values.
93 Extendend "comfortable" construction interface by some methods
94 serving as simple shortcuts.
97 Added a class type to irgs. This class type is to be used as owner
98 for local entities of the procedure. This are all entities allocated
99 for each execution of the procedure.
100 The class type is allocated automatically by new_ir_graph(). Access
101 routines to get this type are in irgraph.h.
102 We chose a class type as this allows to represent "inner" procedures
104 Adapted array-stack-example.
107 irdump outputs nodeids instead of pointers for labels of nodes.
108 With a preprocessor flag in common.h this can be turned off.
111 Added an Id tag to every .c and .h file
114 Changed SSA constuction for exception control flow.
115 If PRECISE_EXC_CONTEXT is used Phi nodes will use the values
116 valid when the execption operation was allocated. This increases
117 the memory consuption of the construction algorithm by
118 n_loc * #fragile_ops.
121 Added method to replace in array of a node in irnode.c/h
122 Added functionality to irgmod:
123 * collect all Phi nodes as link-list in the Blocks link field
124 * collect all Proj nodes as link-list in node producing the tuple.
125 * Seperate a Block into two
126 Added inlining transformation in irgopt.h
127 Improved output of dump_ir_block_graph. Now also dumps nodes that
128 don't belong to a block.
129 Added flag opt_unreachable_code, opt_inline.
130 Changed irvrfy so that it accepts nodes with Bad predecessors.
133 renamed get_type_nameid to get_type_ident
136 Bugfix: dead node elimination did not replace the hash table
140 Added routine remove_irp_irg.
141 Changed comment to free_ir_graph.
144 Added routine to free irgraphs.
147 Improved add routines to sub, supertype in type.c
150 Added implementation of overwrites stuff.
153 Implemented stuff to change the type graph. See
154 typegmod.h and tpop.h for basic documentation of the change.
155 There now exists a type of kind type_id. If this appears
156 externally this is a bug.
159 Added some new access routines to types.
160 List of overwritten fields for entities.
161 Removed a bug in irnode.
164 Added a routine to set the mangled entity name.
165 Added two routines to copy entites.
168 Entities now have two more flags, for visibility and allocation mode.
169 Types that have a layout have a flag indicating whether the layout is
173 We distinguish three kinds of Cond nodes. These can be distinguished
174 by the mode of the selector operand and an internal flag of type cond_kind.
175 First we distinguish binary Conds and switch Conds.
176 A binary Cond has as selector a boolean value. Proj(0) projects the control
177 flow for case "False", Proj(1) the control flow for "True". A binary Cond
178 is recognized by the boolean selector.
179 The switch Cond has as selector an unsigned integer. It produces as result
180 an n+1 Tuple (cf0, ... , cfn) of control flows.
181 We differ two flavours of this Cond. The first, the dense Cond, passes
182 control along output i if the selector value is i, 0 <= i <= n. If the
183 selector value is >n it passes control along output n.
184 The second Cond flavor differes in the treatment of cases not specified in
185 the source program. It magically knows about the existence of Proj nodes.
186 It only passes control along output i, 0 <= i <= n, if a node Proj(Cond, i)
187 exists. Else it passes control along output n (even if this Proj does not
188 exist.) This Cond we call "fragmentary". There is a special constructor
189 new_defaultProj that automatically sets the flavor.
190 The two switch flavors are distinguished by a flag of type cond_kind.
191 Default flavor is "dense"
195 tv now implements Minus, Abs.
196 iropt now optimizes these and Div, Mod, Quot, DivMod.
197 Still missing: Shrs, Rot.
198 tarval_shr somtimes performs shrs, depending on the compiler/system!!
199 If the ArmRoq implementation is faulty there might appear errors.
202 Changed ircons: If undefined values are used the Phi construction
203 inserts a constant with value tarval_bad.
206 Changed array bounds in type.h to ir_node*. This allows to
207 construct array bounds that are complex constant expressions
208 simpler. Further dynamic array bounds can be displayed.
209 Comment in ircons.c extended: undefined values in start_block.
212 ifdef'ed all uses of gmp in tv.c away. Optimizations for
213 mode_Z no more supported, as well as constants of that mode.
216 Dokumentation in ir_dump
217 Habe Routinen fuer einzelne Knoten/Kanten aus header entfernt:
218 Benutzen globale Variable die nicht oeffentlich zugaenglich ist.
221 We need an entity for the array elements for the Sel nodes. This
222 entity should be stored in the array type. Changed constructor
223 parameters: include array element type. Entity for elements is built
228 Faulty use of va_arg, became visible with new, stricter gcc 2.96.
231 Added list of member entites to union. unioned_types and delimiters
232 are superfluous now -- removed.
233 Rationale: we want to express selection of a union member as a Sel
234 node. for this we need to have entities. The entities contain the
235 unioned type and have as name the delimiters...
238 Changed Makefile/MakeTargets to install headers and libraries
242 Changed Makefile and Configure scripts to produce a proper tar file
243 for distribution (libfirm-VERSION.tar)
244 Use 'make distrib' instead of 'make dist'
247 Changed implementation of tr module. With this I also changed the
248 interface!! Type casts are unnecessary now, but some access funcions
252 ======================================================================
253 ==================== New version: 0.3.0 ==============================
254 ======================================================================
260 added creation of a tar archive for distribution
261 replaced ir/.dummy.in by ir/Makefile.in
264 Changed equivalent_node() and copy_preds() so that the end block
265 is not optimized away if it has no real predecessors. This fixes
266 the problem with the while examples.
267 Added while_example in Makefile
270 Fooled around with if_while_example: Why does cse make it abort?
271 Cse removes path to End node, Bad remains as pred of Endblock.
272 The block walker can't deal with this.
273 Made new example with only loop: while_example.
276 added auto documentation in Makefiles, configure, etc
277 example in ir/ir/ircons.c - much must be added
278 creation of documentation by 'make autodoc' in architecture directory
281 added lots of #ifdef HAVE_CONFIG_G #include "config.h" #endif
282 replaced some C++ style comments (//) by standard C comments /**/
285 - configure (with some features, see --help for more)
286 - make [depend | tags | install]
287 - make [run] in testprograms
289 - compilation on SunOS
291 - automatic call of autoconf if required
294 More colours in vcg output.
295 Fixed bug: cse found that start block equals it's
296 first successor as both have the Start block as predecessor.
297 This only happens for local_optimize_graph() as during construction
298 the Start block is not entered in the value table.
299 Changed implementation: irgmod: local_optimize_graph() did not
300 empty the hash table with the irnodes for cse. This might cause that
301 cse turns up with a node that seems better but was removed from the
302 graph in an earlier optimization phase.
303 Removed old #if 1 from ircons.c
304 Commented in call of optimization for Block nodes in irgopt.c, copy_preds():
305 Optimizes blocks that had bad predecessors.
310 Moved struct from irprog.h to irprog_t.h, same for irmode.h.
311 Added a module deb_info in debug.h. Adapted makefile. Added example
313 Removed use of debug.h in ident.c. Now debug.c|h can be moved to
315 Removed inabled code for dead node elimination in irgopt.h.
316 Renamed some missnamed access routines (_of_). Macros with old names
317 are in old_fctnames.h.
318 Edited makefiles to remove #* and *.flc.
321 Some minor bugfixes...
324 After compacting of in arrays in dead_node_elimination
325 merge blocks and remove Phis with one pred.
328 Freeing of obstack in dead_node_elimination commented in.
329 Compacting in arrays of Block and Phi nodes in dead_node_
334 added set/get_SymConst_type_or_id in irnode.h
335 added field offset to entity in entity.h
336 added field size to type_class in type.h
337 include "gmp.h" in tv.h with "" instead <>
340 Some changes to make the lib better portable
343 Initialize max_node_nr in irprog.
346 Now outputs warning if faulty type in irdump, dump_type_info.
347 Explicit string termination in irdump, vcg_open.
350 Added external to declaration of irp.
351 Added typedef before pns and pnc_number.
352 irmode.c, init_mode(): We need to memset all new modes as
353 tarval_vrfy reads fields before they are initialized: It
354 compares to min/max when tarvals for min/max are allocated!
357 Changed parameter of Methods in type.h and type.c from
358 class to clss. Class is a C++ keyword.
361 Changed some testprograms to accomodate Uebprakt.
364 Finished implementation of dump_all_types.
365 Added new testprogram inheritance_example.
368 Added seven access routines in type.[hc]:
369 get_class_n_member, get_class_n_subtype, get_class_n_supertype,
370 get_strct_n_member, add_strct_member, get_strct_member and set_strct_member.
371 Fixed the type_walk_2 for those seven routines.
374 Added irdump routine dump_all_types.
375 Did changes to irprog, type, typewalk to achieve this.
376 typewalk needs to walk along members, sub and supertypes, this
377 is still missing! irdump then needs to output these edges.
379 ======================================================================
380 ==================== New version: 0.2.5 ==============================
381 ======================================================================
384 Made new Version: 0.2.5
386 15.8.2000 Goetz until 3.9.00
387 Separated irnode.h and many others into two files: one public
389 Added funcionality to extract headers for lib.
392 type_dump also dumps irg->ent
393 if_example: corrected nr of locals
396 irgopt: Correct copy of self pointer in start block.
397 irgopt: Correct treatment of loops: pre function in walker
398 breaks all possible loops in Phi and Block nodes.
399 irr_loop_example: wrong Return statement
400 Now I fixed all but one error: in memory_example.
401 This error showed a conceptual problem, so I wrote
402 a slightly different algorithm. This now runs for
404 dead_node_example: cse is buggy!! merges start and the
408 looking at bug in dead_node_elimination.
410 irnode: all get_..._arr functions changed
411 ircons: new_r_Block: set matured flag.
412 ircons: new_r_SymConst: needs mode_p for linkage_ptr_info.
413 adapted call_str_example to new concepts.
416 Implemented simpler Phi construction algorithm that constructs
417 correct code for three_cfpred_example in ircons. This algorithm
418 generates more Id nodes than the original algorithm and therefore
420 Also made some changes to optimizations of Not.
423 Fixed a bug, caused by the recursive use in type.h and entity.h.
424 Deleted the _TYPE_TYPEDEF_ and inserted the _ENTITY_TYPEDEF_ instead.
425 Fixed a problem in if_while testprogram, so it now works.
428 Fixed bug in optimize(). Returned Null instead n if
429 get_optimize() == false.
432 Added some access routines in type.[hc]. Solved a recursive definition
433 of type_class struct, entity struct and type union.
436 Separated entity header into pure functional header and header
440 ... a bunch small changes not documented
443 Changed output of oo_prog_example: now uses the internal list
444 of all irgs. Had to implement some of the access routines for
445 that. Also fixed a bug in irdump. Main routines did not use
446 current_ir_graph properly.
449 Implemented some missing parts in irgopt.
450 Added field irg to entity. Only valid if entity is a method.
451 Had to resove a cyclic de[endency between irgraph.h and entity.h
453 Added fields sub and super to type_class for inheritance.
454 Added field main_irg to irprog.
457 Fixed some bugs in irgopt.c
458 Added some missing 'get_new_node' methods, so the new obstack contains
462 Renamed ir_vrfy to irn_vrfy and vrfy_graphg to irg_vrfy.
463 Solved some copy'n'paste problems. Deleted most debug-code!
464 Added comments to several files.
467 Fixed bug in _r_ constructors for all four Div operations.
468 Fixed bug in turn_into_tuple: didn't remember the block.
469 Tested transform_node.
472 Fixed some testprograms to new semantics of firm.
473 Added testprogram global_var_example.
474 Fixed a bug in irop: Size of Sel node was (entity *) instead of
475 sel_attr. Therefor array_heap_example aborted.
476 Also found a missing break in typewalk, case iro_Alloc.
477 Added a construct that unifies all things constructed by the lib
478 and needed to represent a program: irprog.ch
479 This contains a list of all types as well as a list of all ir graphs.
480 I added calls to initialization and constructors so that this is constructed
481 automatically. I changed firm.c, type.c, irgraph.c and ev. more.
482 Removed strange block struct and constructor from ircons.c.
483 Moved routines for automatic Phi construction from irgmod to ircons.
484 Sorted functions in ircons to reflect the different interfaces.
485 Renamed dataseg to globals to be conformant with documentation.
486 Added conservation of current_ir_graph to irgopt.c.
487 Corrected bug in Makefiles: wrong path to directory ./inlude.
490 Commented a whole bunch of stuff, e.g. in ircons.h (Procedure to construct)
491 We should change the naming of the Block constructor.
492 Removed acces routines to attr. "closed" of Block.
493 Removed second implementation of new_ir_node from ircons and some comments
494 concerned with the now resolved cyclic dependency.
495 Fixed some bugs in irgopt so that the compilation goes through.
498 Changed the irnode attribut 'visit' into 'visited'.
499 Added some access functions, like get/set_irn_visit etc.
502 Renamed some access funtion in irgraph.*.
503 Deleted two global flags (ir_visited and block_visited) from irgraph.*.
504 Added two attributes to the irgraph struct. The visited flags belongs
505 to a ir graph, not to a whole program.
508 A new optimization has been finished. The dead-node-elimination copies
509 the existing ir graph from one opstack to another. While walking the
510 graph, only the reachable nodes will be copied, so the "dead-nodes"
511 (unreachable in the controlflow) are removed.
514 Solved some problems in the 'copy_node' function. The in array was not
515 as easy as it seamed.
518 Wrote a new 'post' funtion, for future use in 'dead-node-elimination'
519 optimization, which is needed in the paramter list of 'irg_walk'.
522 Moved 'optimze_in_place_wrapper' from iropt.* tothe new files irgopt.*.
523 New functions 'local_optimze_graph' and 'dead_node_elimination' are added,
527 Removed some files from the archive, after dependencies and usage are
529 - 'ir/common/strerror.c'
531 - 'ir/ident/xx_ident.h'
532 an empty file, only included by 'ident.c', but never used;
533 - 'ir/tv/label.c' and
535 contained a numeric counter;
536 The files were included in 'tv.h' and implemented in 'tarval.c'. The two
537 functions 'tarval_label' and 'tarval_forall_labeled' were also never used.
538 In the old fiasco compiler, the label thing is used in the backend.
539 Search for 'babil' to see the usage.
540 Also removed the two attributes 'lab' and 'used' in the tarval struct.
543 Moved the 'new_ir_node' constructor from ircons.* to irnode.* and fixed
544 afterwards some recursive includes, so libfirm works again.
547 Did a lot of changes, which I never commented until now (4.7.00).
549 * Added new result to Start node: Pointer to global data segment.
550 * Extended Semantics of SymConst node to represent information for the
552 * Added arithmeitc nodes (Shrs, Minus ...)
554 Rearranged the directory structure and adjusted the makefiles.
555 The directories contain:
556 ir: everything for the intermediate representation (better: src?)
557 /ir: the ir itself, and standard optimizations.
558 /tv: the target value module
559 /tr: the type and entity representation
560 /adt: abstract data types
561 /common: stuff needed by all other dirs
562 /debug: debugging Unterstuetzung
564 include: external files needen as includes
565 testprograms: examples to test the lib.
567 The makefiles generate files with extension .d that contain the dependencies
571 Added access routine to attribute link of irnode in irnode.ch.
572 Added get_negated_pnc to irnode.ch.
575 Added an iterator in iropt that calls the optimization for all nodes.
576 Copied optimize's code to optimize_in_place and removed deallocations.
577 Made set_irn_n in irnode.c public.
578 Added Bad as possible cfg predecessor in is_cfg_node in irnode. Bads
579 are allowded as cfgpredecessors to represent dead "incoming" control
581 Added call to optimize_in_place in mature_block. Is this useful?
584 Changed tests from comparing enums to comparing pointers. This is more
585 efficient (is it?) and reads better. e.g., instead get_irn_opcode == irm_And
586 now get_irn_op == op_And
589 Compared equivalent_value to the one in the original fiasco.
590 Added a test in case iro_And.
591 Changed implementation of iro_Div. Added routines turn_into_tuple
592 and set_irn_op() in irgmod/irnode.
593 Changed implementation of irn_Minus (although commented out).
594 Now all features are ported or documented for this function.
597 Compared computed_value to the one in the original fiasco.
598 Added one further optimization in case iro_Proj.
599 Now all features are ported for this function.
602 Updated comments in ircons.h.
605 Changed possible attribute of SymConst from type_class to type.
606 SymConst size could be the size of a union, array, ...
609 Implemented two dumpers that dump type information and a graph with
613 Implemented a walker that walks over the type informatin that can
614 be reached from an ir node.
615 Added routine get_kind(firm_thing) in common.h, Added file common.c.
616 Added files typewalk.ch and routines to irdump.
617 Added visited flags and initialization to entity and all types.
618 Implemented some of the missing access routines in type.c, entity.c
621 Implemented constructor for ShrA.
623 Added routine that iterates the graph and verifies all nodes.
624 Added Phi_in stack to irgraph. This allows to build several
625 graphs at once with respect to the Phi building algorithm.
628 Implemented dumper for control flow graphs. Changed irr_* and dead_*
629 examples to dump cfg.
632 Implemeted explicit stack for the Phi node generation. See ircons.c.
635 added include string.h in xoprintf.c to get rid of warning:
636 implicit declaration of function `bcopy'
640 Added more cases to equivalent_node.
641 Portet gigo, identify, identify_remember.
642 The set/pset library can not handle several hash tables. At least,
643 compiling several procedures causes a segmentation fault during access
644 to the tables (oo_program_example). Need to work on this.
645 transform_node still needs to be ported.
646 some cases in equivalent_node are still missing.
648 To get it running I had to remove the call to optimize in the
649 new_Block constructor. It can only be called when the Block is
653 Introduced a walker that walks only over blocks. The asserts
654 might be too strict for general graphs, but so far it works.
655 For the walker I introduced an additional flag in the attribute
656 of Blocks, an a global block_visited variable (in irgraph.h).
657 Furhter I modularized dump_ir_node, implemented dump_ir_graph
658 with the existing walker, and added new routines to output a
660 Changed the examples to call the new dump routine.
663 Added auxiliary routines to ir_node:
664 skip_Proj, skip_Nop, is_Bad ...
665 Changed access routines to use get_irn_n instead of explicit array
666 accesses. Changed get_irn_n to call skip_Id, so that the access routines
667 never will return Id nodes.
670 Repaired Phi computation, changed new_r_Phi_in. Added test program to
671 test irregular controlflow.
674 Updated optimizations computed_value and equivalent_node to new
675 Syntax of FIRM nodes and to use access routines.
676 Added routine skip_Proj in irnode.
678 2.2.2000 Boris Boesler
679 Added files irgwalk.c and irgwalk.h. They include a simple function to
680 traverse an ir graph and execute pre and post functions to current node.
683 Added arrays with parameters and result types to the type informtion
684 of a procedure. This is needed for the code generation. Also added
685 the corresponding access routines.
686 Adapted the testprograms.
689 Found a bug / complication: the call order
690 get_value (makes Phi0, put's it into graph_arr)
691 set_value (overwrites Phi0 in graph_arr)
692 mature_block (upgrades Phi0, puts it again into graph_arr, overwriting
694 fails. Added test wether graph_arr is already set in phi_merge.
696 Added tons of comments to explain Phi generation -- the stack hack.
700 irdump now outputs the pnc_number for projs of Cmp nodes.
701 Added routine to access the pnc_string.
704 Added result "dataseg" to Start node, with all it's consequences.
705 We need this for the compiler lab to translate global variables.
706 Now they can be selected from the data segment, and the start
707 node supplies the pointer to this segment.
708 These changes are guarded by preprocessor variable UEBPRAKT in
710 Changed files: common.h, irgraph.ch, irnode.h
714 removed array_example, added array-heap_example and
715 array-stack_example and adapted makefile.
717 Entity now also allows type_method as owner. This is to model
718 the stack, Sel nodes that select a variable (array) from the
719 stack need an entity that describes what they select. This
720 entity gets the type of the enclosing procedure as owner.
723 Added future access routines in `irmode.[ch]' as comments,
724 that all attributes in the ir_mode struct can be user-defined.
725 Added access routines in `irgraph.[ch]', for all attributes.
728 Moved verify routines from `irgraph.[ch]' to own files `irvrfy.[ch]'.
729 Added `irvrfy.[ch]' to MAKEFILE
730 Added "inline" before access routines in `irnode.h', that no warnings
731 will appear furthermore.
732 Added three more access routines in `irmode.[ch]':
733 struct tarval *get_min_of_mode (ir_mode *mode);
734 struct tarval *get_max_of_mode (ir_mode *mode);
735 struct tarval *get_null_of_mode (ir_mode *mode);
738 Adaption of Alloc, Sel and Entity to new types:
739 Changed array_example to use type instead of type_class.
740 Changed entity to allow all types as owner instead of
741 only type_class. Added routine "assert_legal_owner_of_ent(type* type)".
742 Changed alloc to allow allocating variables of any type instead of
744 Adapted all testprograms to avoid warnings.
746 removed dtest ... from Makefile, replaced by test.
749 Added "run" to makefile, added array_example to makefile of testprograms.
750 Corrected testprogram array
751 Changed assert in irvrfy -- Conv.