libfirm
13 years agoverify that all blocks can be found by walk_block_graph
Matthias Braun [Thu, 5 May 2011 13:31:58 +0000 (15:31 +0200)]
verify that all blocks can be found by walk_block_graph

This also ensures the invariant that at least 1 block in an endless
loop is kept.

13 years agoircfscc: remove is_outermost_StartBlock check - it was broken and apparently unnecessary
Matthias Braun [Thu, 5 May 2011 13:30:56 +0000 (15:30 +0200)]
ircfscc: remove is_outermost_StartBlock check - it was broken and apparently unnecessary

13 years agolittle cleanup, avoid unnecessary optimize_graph_df
Matthias Braun [Thu, 5 May 2011 11:24:02 +0000 (13:24 +0200)]
little cleanup, avoid unnecessary optimize_graph_df

13 years agogive Bad nodes a mode
Matthias Braun [Wed, 4 May 2011 11:48:18 +0000 (13:48 +0200)]
give Bad nodes a mode

13 years agomark outs as inconsistent when end node is changed
Matthias Braun [Thu, 5 May 2011 11:22:48 +0000 (13:22 +0200)]
mark outs as inconsistent when end node is changed

13 years agooptimize_graph_df: iterate marking of unreachable blocks to guarantee that all unreac...
Matthias Braun [Thu, 5 May 2011 09:31:58 +0000 (11:31 +0200)]
optimize_graph_df: iterate marking of unreachable blocks to guarantee that all unreachable code is killed

13 years agoPrevent endless recursion in if-conv in endless loops.
Christoph Mallon [Thu, 5 May 2011 16:47:40 +0000 (18:47 +0200)]
Prevent endless recursion in if-conv in endless loops.

13 years agoA function that (indirectly) calls itself is not const/pure.
Sebastian Buchwald [Thu, 5 May 2011 14:32:41 +0000 (16:32 +0200)]
A function that (indirectly) calls itself is not const/pure.

This fixes opt/fehler186.c and ack/test2.c.

13 years agoFix embarrassing typo in fp-vrp.
Christoph Mallon [Thu, 5 May 2011 14:55:23 +0000 (16:55 +0200)]
Fix embarrassing typo in fp-vrp.

13 years agoUse the bound of ==-Confirms in fixpoint vrp.
Christoph Mallon [Thu, 5 May 2011 14:20:37 +0000 (16:20 +0200)]
Use the bound of ==-Confirms in fixpoint vrp.

13 years agoRemove pointless local variables.
Christoph Mallon [Thu, 5 May 2011 11:58:36 +0000 (13:58 +0200)]
Remove pointless local variables.

13 years agofix opt/loop_without_phi
Andreas Zwinkau [Thu, 5 May 2011 09:26:07 +0000 (11:26 +0200)]
fix opt/loop_without_phi

Memory loops without Phis can occur in unreachable code.
Make ldstopt handle this by ignorance.

13 years agofix opt/gcse_no_end
Andreas Zwinkau [Thu, 5 May 2011 08:15:19 +0000 (10:15 +0200)]
fix opt/gcse_no_end

jump threading must also copy Keep edges to keep End reachable.

13 years agocfopt: fix countless bugs introduced when changing unreachable code elimination
Matthias Braun [Wed, 4 May 2011 23:40:23 +0000 (01:40 +0200)]
cfopt: fix countless bugs introduced when changing unreachable code elimination

13 years agofix cfopt not marking all possible blocks as removable after the latest changes
Matthias Braun [Wed, 4 May 2011 21:16:38 +0000 (23:16 +0200)]
fix cfopt not marking all possible blocks as removable after the latest changes

13 years agofix unreachable code elimination failing for blocks with only 1 input
Matthias Braun [Wed, 4 May 2011 14:42:33 +0000 (16:42 +0200)]
fix unreachable code elimination failing for blocks with only 1 input

13 years agoConsider that unreachble blocks might have no bitinfo.
Christoph Mallon [Wed, 4 May 2011 13:58:59 +0000 (15:58 +0200)]
Consider that unreachble blocks might have no bitinfo.

13 years agoAssert monotonicity in set_bitinfo().
Christoph Mallon [Wed, 4 May 2011 13:38:40 +0000 (15:38 +0200)]
Assert monotonicity in set_bitinfo().

13 years agoEnsure that the result of a node is undefined if any of its operands is undefined...
Christoph Mallon [Wed, 4 May 2011 13:26:18 +0000 (15:26 +0200)]
Ensure that the result of a node is undefined if any of its operands is undefined (except for phis) or if its block is unreachble.

13 years agoConsider that unreachble blocks might have no bitinfo.
Christoph Mallon [Wed, 4 May 2011 12:54:28 +0000 (14:54 +0200)]
Consider that unreachble blocks might have no bitinfo.

13 years agoCorrectly handle the case that unreachble blocks are not necessarily replaced before...
Christoph Mallon [Wed, 4 May 2011 12:35:00 +0000 (14:35 +0200)]
Correctly handle the case that unreachble blocks are not necessarily replaced before the nodes they contain.

13 years agoModel (un)reachable block info with bottom/top, not false/true.
Christoph Mallon [Wed, 4 May 2011 10:42:05 +0000 (12:42 +0200)]
Model (un)reachable block info with bottom/top, not false/true.

13 years agoInitially mark the end block as reachable and set the bad node to bottom (i.e. undefi...
Christoph Mallon [Tue, 3 May 2011 17:38:43 +0000 (19:38 +0200)]
Initially mark the end block as reachable and set the bad node to bottom (i.e. undefined).

13 years agoFetch traval false/true once in transfer() for better readability.
Christoph Mallon [Tue, 3 May 2011 11:50:42 +0000 (13:50 +0200)]
Fetch traval false/true once in transfer() for better readability.

13 years agoalways compute doms in optimize_graph_df instead of hoping for them to be available
Matthias Braun [Wed, 4 May 2011 08:54:13 +0000 (10:54 +0200)]
always compute doms in optimize_graph_df instead of hoping for them to be available

13 years agoAmend combo fix.
Michael Beck [Tue, 3 May 2011 14:25:52 +0000 (16:25 +0200)]
Amend combo fix.

One more condition is needed to ensure monotony.

13 years agoFixed combo by fixing an old artefact from the older libFirm Cmp nodes.
Michael Beck [Tue, 3 May 2011 09:52:11 +0000 (11:52 +0200)]
Fixed combo by fixing an old artefact from the older libFirm Cmp nodes.

In older libFirm version, Cmp computes top, true or bottom.
Now Cmp computes true or false, so the monotony fix must be upgraded.

This fixes opt/combo_paper.c

13 years agoBugFix: mode_b lowering might create new control flow (if ir_create_cond_set() is...
Michael Beck [Tue, 3 May 2011 09:49:41 +0000 (11:49 +0200)]
BugFix: mode_b lowering might create new control flow (if ir_create_cond_set() is used), so invalidate analysis data.

13 years agoBugFix: Always invalidate loop-info if data flow was changed.
Michael Beck [Tue, 3 May 2011 09:48:58 +0000 (11:48 +0200)]
BugFix: Always invalidate loop-info if data flow was changed.

13 years agofix lower_mode_b: phi inputs may be bad
Matthias Braun [Mon, 2 May 2011 12:04:43 +0000 (14:04 +0200)]
fix lower_mode_b: phi inputs may be bad

13 years agoalso do unreachable code elimination during gcse
Matthias Braun [Mon, 2 May 2011 09:06:33 +0000 (11:06 +0200)]
also do unreachable code elimination during gcse

13 years agoimprove robustness of CFG verifier for strange cases with Tuples
Matthias Braun [Fri, 29 Apr 2011 17:15:55 +0000 (19:15 +0200)]
improve robustness of CFG verifier for strange cases with Tuples

13 years agoenqueue users of Bad as well in optimize_graph_df
Matthias Braun [Fri, 29 Apr 2011 16:34:28 +0000 (18:34 +0200)]
enqueue users of Bad as well in optimize_graph_df

13 years agoonly calculate dominance if CFG verification was fine to avoid crashs/endless loops
Matthias Braun [Fri, 29 Apr 2011 16:18:55 +0000 (18:18 +0200)]
only calculate dominance if CFG verification was fine to avoid crashs/endless loops

13 years agocleanup/partly rewrite code_placement algo
Matthias Braun [Fri, 29 Apr 2011 15:52:14 +0000 (17:52 +0200)]
cleanup/partly rewrite code_placement algo

13 years agoFurther push size_t.
Michael Beck [Sat, 30 Apr 2011 23:21:37 +0000 (01:21 +0200)]
Further push size_t.

13 years agoC99 feature removed.
Michael Beck [Sat, 30 Apr 2011 23:11:49 +0000 (01:11 +0200)]
C99 feature removed.

13 years agoAdd simple transfer function for Confirm in fp-vrp.
Christoph Mallon [Fri, 29 Apr 2011 11:50:24 +0000 (13:50 +0200)]
Add simple transfer function for Confirm in fp-vrp.

13 years agodo not kill unreachable code in gcse
Matthias Braun [Fri, 29 Apr 2011 11:11:58 +0000 (13:11 +0200)]
do not kill unreachable code in gcse

13 years agoImprove and correct fp-vrp transformation.
Christoph Mallon [Fri, 29 Apr 2011 10:52:53 +0000 (12:52 +0200)]
Improve and correct fp-vrp transformation.

- Set modified flag when unreachble nodes are removed.
- Remove trivially unreachble blocks, which have no bitinfo.
- Consider that unreachble blockes are replaced by Bad before the nodes they contain.

13 years agoClean up in ifconv a bit.
Christoph Mallon [Thu, 28 Apr 2011 12:56:27 +0000 (14:56 +0200)]
Clean up in ifconv a bit.

13 years agoadd libfirmprof helper library
Matthias Braun [Thu, 28 Apr 2011 14:51:02 +0000 (16:51 +0200)]
add libfirmprof helper library

13 years agoimprove firm profiler (based on patch by Steven Schäfer)
Matthias Braun [Thu, 28 Apr 2011 14:47:06 +0000 (16:47 +0200)]
improve firm profiler (based on patch by Steven Schäfer)

13 years agodump postdom info in vcg graphs
Matthias Braun [Thu, 28 Apr 2011 08:27:58 +0000 (10:27 +0200)]
dump postdom info in vcg graphs

13 years agofix an intrinsic lower not reporting changes
Matthias Braun [Wed, 27 Apr 2011 16:50:50 +0000 (18:50 +0200)]
fix an intrinsic lower not reporting changes

13 years agofix lower_copyB not invalidating irn_outs
Matthias Braun [Wed, 27 Apr 2011 16:19:56 +0000 (18:19 +0200)]
fix lower_copyB not invalidating irn_outs

13 years agoimprove fp-vrp unreachable code handling
Matthias Braun [Wed, 27 Apr 2011 14:49:16 +0000 (16:49 +0200)]
improve fp-vrp unreachable code handling

13 years agoSimplify handling of unreachable code
Matthias Braun [Thu, 21 Apr 2011 13:58:53 +0000 (15:58 +0200)]
Simplify handling of unreachable code

See http://www.libfirm.org/Unreachable_Code for details

13 years agoVerify that each Cond has a true/false/default Proj
Matthias Braun [Thu, 28 Apr 2011 08:47:51 +0000 (10:47 +0200)]
Verify that each Cond has a true/false/default Proj

13 years agoadd cfg verifier ensuring 1 cfop per block and only 1 user for each mode_X node
Matthias Braun [Wed, 27 Apr 2011 11:47:30 +0000 (13:47 +0200)]
add cfg verifier ensuring 1 cfop per block and only 1 user for each mode_X node

13 years agoadd unknown_jump opflag for the special case of a jump where we can't directly influe...
Matthias Braun [Wed, 27 Apr 2011 11:46:56 +0000 (13:46 +0200)]
add unknown_jump opflag for the special case of a jump where we can't directly influence the destination and can't predict/change them

13 years agoremove obsolete #defines
Matthias Braun [Wed, 27 Apr 2011 11:41:13 +0000 (13:41 +0200)]
remove obsolete #defines

13 years agocleanup/reformat irop_t.h
Matthias Braun [Wed, 27 Apr 2011 11:34:45 +0000 (13:34 +0200)]
cleanup/reformat irop_t.h

13 years agoverify that the predecessor of a block is a cfop
Matthias Braun [Wed, 27 Apr 2011 11:22:31 +0000 (13:22 +0200)]
verify that the predecessor of a block is a cfop

13 years agolittle cleanup in block walker code
Matthias Braun [Tue, 26 Apr 2011 17:24:37 +0000 (19:24 +0200)]
little cleanup in block walker code

13 years agomake verifier a bit less strict for out-edges to dead code
Matthias Braun [Tue, 26 Apr 2011 17:24:07 +0000 (19:24 +0200)]
make verifier a bit less strict for out-edges to dead code

13 years agofix warnings
Matthias Braun [Tue, 26 Apr 2011 10:28:54 +0000 (12:28 +0200)]
fix warnings

13 years agoslight cleanup of ifconv code
Matthias Braun [Thu, 21 Apr 2011 09:30:00 +0000 (11:30 +0200)]
slight cleanup of ifconv code

13 years agoFixed size_t related warning.
Sebastian Buchwald [Thu, 28 Apr 2011 08:13:05 +0000 (10:13 +0200)]
Fixed size_t related warning.

13 years agoBetter fix for opt/ldst.c
Andreas Zwinkau [Tue, 26 Apr 2011 15:25:54 +0000 (17:25 +0200)]
Better fix for opt/ldst.c

This avoids a Load without ProjM, instead of handling this case.

Reverts the previous commit.

13 years agoFix opt/ldst.c
Andreas Zwinkau [Tue, 26 Apr 2011 12:04:00 +0000 (14:04 +0200)]
Fix opt/ldst.c

A Load might not have a ProjM

13 years agoBugFix: fixed broken refactoring, associated link cannot be used for chains.
Michael Beck [Mon, 25 Apr 2011 21:00:28 +0000 (23:00 +0200)]
BugFix: fixed broken refactoring, associated link cannot be used for chains.

The associated link combinaes onbe lowered awith one unlowered type,
it cannot be used for chains of unlowered types.

Removes the get_type_[un]lowered() API and restores the
get_associated_type() API.

However, the whole concept of lowered types should be replaced by type
attributes ...

This fixes the asserts in stabs debug output.

13 years agoSlightly improved type dumper.
Michael Beck [Mon, 25 Apr 2011 21:01:27 +0000 (23:01 +0200)]
Slightly improved type dumper.

13 years agoFixed some size_t related warnings.
Michael Beck [Sun, 24 Apr 2011 13:54:52 +0000 (15:54 +0200)]
Fixed some size_t related warnings.

13 years agoFixed the "naive and wrong regex stubs", so it has the right signature and returns...
Michael Beck [Sun, 24 Apr 2011 13:14:21 +0000 (15:14 +0200)]
Fixed the "naive and wrong regex stubs", so it has the right signature and returns the right value/error code now.

13 years agoSwitch irg index to type size_t, making the API more consistent.
Michael Beck [Sun, 24 Apr 2011 12:53:34 +0000 (14:53 +0200)]
Switch irg index to type size_t, making the API more consistent.

13 years agoFix opt/jumpthreading4.c
Andreas Zwinkau [Thu, 21 Apr 2011 12:24:18 +0000 (14:24 +0200)]
Fix opt/jumpthreading4.c

13 years agoThe constructor initializes the array.
Sebastian Buchwald [Wed, 20 Apr 2011 16:34:49 +0000 (18:34 +0200)]
The constructor initializes the array.

13 years agoUse corresponding macro.
Sebastian Buchwald [Wed, 20 Apr 2011 16:30:24 +0000 (18:30 +0200)]
Use corresponding macro.

13 years agoSimplify code.
Sebastian Buchwald [Wed, 20 Apr 2011 16:28:35 +0000 (18:28 +0200)]
Simplify code.

13 years agoSimplify: if (!irn_visited(x)) { mark_irn_visited(x); ... } -> if (!irn_visited_els...
Christoph Mallon [Wed, 20 Apr 2011 16:35:12 +0000 (18:35 +0200)]
Simplify: if (!irn_visited(x)) { mark_irn_visited(x); ... }  ->  if (!irn_visited_else_mark(x)) { ... }.

13 years agoFix opt/doms_segfault.c
Andreas Zwinkau [Wed, 20 Apr 2011 14:58:26 +0000 (16:58 +0200)]
Fix opt/doms_segfault.c

13 years agoRefactoring: remove goto
Andreas Zwinkau [Wed, 20 Apr 2011 13:35:55 +0000 (15:35 +0200)]
Refactoring: remove goto

13 years agofix backend/lower_call3.c
Andreas Zwinkau [Wed, 20 Apr 2011 12:49:30 +0000 (14:49 +0200)]
fix backend/lower_call3.c

13 years agoRemove unnecessary assert
Andreas Zwinkau [Wed, 20 Apr 2011 12:15:17 +0000 (14:15 +0200)]
Remove unnecessary assert

This is asserted in the next statement anyways

13 years agoRemove type lower functions from API
Andreas Zwinkau [Wed, 20 Apr 2011 12:12:06 +0000 (14:12 +0200)]
Remove type lower functions from API

* get_associated_type is unnecessary
* is_lowered_type is an internal inline function now
* set_lowered_type is an internal inline function now

13 years agoUse get_type_[un]lowered instead of get_associated_type
Andreas Zwinkau [Wed, 20 Apr 2011 11:46:28 +0000 (13:46 +0200)]
Use get_type_[un]lowered instead of get_associated_type

13 years agoHandle chains of lowerings correctly
Andreas Zwinkau [Wed, 20 Apr 2011 11:33:06 +0000 (13:33 +0200)]
Handle chains of lowerings correctly

13 years agois_lowered_type is now only used in asserts
Andreas Zwinkau [Wed, 20 Apr 2011 11:01:37 +0000 (13:01 +0200)]
is_lowered_type is now only used in asserts

13 years agoadd simple load-after-load and loaf-after-store optimization as localopt
Matthias Braun [Wed, 20 Apr 2011 09:30:42 +0000 (11:30 +0200)]
add simple load-after-load and loaf-after-store optimization as localopt

13 years agoadd no register requirement to NoMem
Matthias Braun [Wed, 20 Apr 2011 08:37:58 +0000 (10:37 +0200)]
add no register requirement to NoMem

13 years agohide cdep struct behind getter, make it more robust with an additional skip_Id
Matthias Braun [Tue, 19 Apr 2011 14:33:21 +0000 (16:33 +0200)]
hide cdep struct behind getter, make it more robust with an additional skip_Id

13 years agoremove strange function (christophs words) and duplicated comments
Matthias Braun [Tue, 19 Apr 2011 14:35:25 +0000 (16:35 +0200)]
remove strange function (christophs words) and duplicated comments

13 years agoWe do not need to place Phis in dead blocks.
Sebastian Buchwald [Wed, 20 Apr 2011 10:11:04 +0000 (12:11 +0200)]
We do not need to place Phis in dead blocks.

This fixes opt/jumpthreading3.c.

13 years agoRefactoring
Andreas Zwinkau [Wed, 20 Apr 2011 08:25:17 +0000 (10:25 +0200)]
Refactoring

* removed unnecessary call_tp variable
* removed shadowed tp variable (twice)

13 years agoFix backend/lower_call2.c
Andreas Zwinkau [Wed, 20 Apr 2011 08:21:09 +0000 (10:21 +0200)]
Fix backend/lower_call2.c

Similiar to 9d207c0 the call lowering should always use the current
entity type, instead of the associate type, which may or may not be
a lowered type.

13 years agoBugFix: Fixed wrong todo fix.
Michael Beck [Wed, 13 Apr 2011 13:37:03 +0000 (15:37 +0200)]
BugFix: Fixed wrong todo fix.

13 years agoFixes backend/lower_call.c
Andreas Zwinkau [Tue, 19 Apr 2011 13:38:57 +0000 (15:38 +0200)]
Fixes backend/lower_call.c

- is_lowered_type is not helpful, because the flag may already be set
  by lower_calls before. This flag should probably be removed in general.
- hence lower_mtp must not check for is_lowered_type
- lower_Start must update the entity type, but not lower_irg,
  otherwise lower_Start can not decide, whether a lowering is necessary.

13 years agono name shadowing
Andreas Zwinkau [Tue, 19 Apr 2011 13:21:09 +0000 (15:21 +0200)]
no name shadowing

13 years agopadded return is only an obscurity of the athlon branch predicator AFAIK
Matthias Braun [Mon, 18 Apr 2011 17:11:10 +0000 (19:11 +0200)]
padded return is only an obscurity of the athlon branch predicator AFAIK

13 years agoremove outdated README.IPD
Matthias Braun [Mon, 18 Apr 2011 10:45:28 +0000 (12:45 +0200)]
remove outdated README.IPD

13 years agochange NEWS and README to markdown format
Matthias Braun [Mon, 18 Apr 2011 10:44:15 +0000 (12:44 +0200)]
change NEWS and README to markdown format

13 years agoC99 feature removed.
Michael Beck [Sat, 16 Apr 2011 23:42:24 +0000 (01:42 +0200)]
C99 feature removed.

13 years agoPrevent SSA construction from running into endless loops.
Sebastian Buchwald [Fri, 15 Apr 2011 14:12:37 +0000 (16:12 +0200)]
Prevent SSA construction from running into endless loops.

If there is an unreachable loop (i.e. there is no loop entry edge)
then there may is a cycle of blocks with only one predecessor.
Since the algorithm handle this case by returning the value of the predecessor,
this causes an endless recursion.
The fix uses the visited flag to detect such cycles.

13 years agoFix stupid typo
Andreas Zwinkau [Fri, 15 Apr 2011 14:18:03 +0000 (16:18 +0200)]
Fix stupid typo

13 years agoHarden ssacons against reintroducing a bug
Andreas Zwinkau [Fri, 15 Apr 2011 14:12:20 +0000 (16:12 +0200)]
Harden ssacons against reintroducing a bug

* use a local variable for the walker function
* use setter function for block settings

13 years agoUse block walk for ssa_cons_start
Andreas Zwinkau [Fri, 15 Apr 2011 13:58:44 +0000 (15:58 +0200)]
Use block walk for ssa_cons_start

The node walk used before was inefficient,
since everything but blocks was ignored.

Additionally, this fixes a bug, because ssa_cons_finish already used a
block walk already, such that unreachable blocks were immatured,
but not matured in the scalar-replace optimization. This bug could
also be avoided by ensuring cfopt before scalar-replace, but keeping
ssacons start and finish symmetric seems to be more robust.

13 years agofix mismatched decl/implementation
Matthias Braun [Fri, 15 Apr 2011 12:41:13 +0000 (14:41 +0200)]
fix mismatched decl/implementation

13 years agoimplement some cases of =A asm-constraint
Matthias Braun [Fri, 15 Apr 2011 12:28:41 +0000 (14:28 +0200)]
implement some cases of =A asm-constraint

13 years agofix cmp_ASM_attr
Matthias Braun [Fri, 15 Apr 2011 11:02:31 +0000 (13:02 +0200)]
fix cmp_ASM_attr