libfirm
11 years agoRemove keep-edge hacks for endless loop.
Christoph Mallon [Thu, 8 Nov 2012 07:21:09 +0000 (08:21 +0100)]
Remove keep-edge hacks for endless loop.

It is the job of the frontend to keep loops.
These hacks here only worked for some, but not all cases.
In particular a more clever SSA-construction algorithm might not place redundant PhiMs, which would render memory before memory-less loops unkept.

11 years agoSimplify code generator and generated code using C99.
Christoph Mallon [Wed, 7 Nov 2012 07:14:35 +0000 (08:14 +0100)]
Simplify code generator and generated code using C99.

11 years agoRemove redundant assert().
Christoph Mallon [Wed, 7 Nov 2012 06:58:20 +0000 (07:58 +0100)]
Remove redundant assert().

get_irn_op_() checks the same.

11 years agoFix typos in comments.
Christoph Mallon [Wed, 7 Nov 2012 06:57:38 +0000 (07:57 +0100)]
Fix typos in comments.

11 years agoInline x87_set_tos() into its only caller.
Christoph Mallon [Mon, 5 Nov 2012 13:50:18 +0000 (14:50 +0100)]
Inline x87_set_tos() into its only caller.

11 years agoRemove cruft from sim_Copy().
Christoph Mallon [Sun, 4 Nov 2012 19:35:36 +0000 (20:35 +0100)]
Remove cruft from sim_Copy().

11 years agoRemove redundant assert.
Christoph Mallon [Sun, 4 Nov 2012 14:37:16 +0000 (15:37 +0100)]
Remove redundant assert.

sched_add_after() checks this, too.

11 years agoRemove the unused return value from x87_create_fxch().
Christoph Mallon [Sat, 3 Nov 2012 19:01:38 +0000 (20:01 +0100)]
Remove the unused return value from x87_create_fxch().

11 years agoGet rid of x87_push_dbl() by passing an usable register to x87_create_fpush().
Christoph Mallon [Sat, 3 Nov 2012 13:53:34 +0000 (14:53 +0100)]
Get rid of x87_push_dbl() by passing an usable register to x87_create_fpush().

11 years agoDo not add a Proj to the schedule.
Christoph Mallon [Sat, 3 Nov 2012 12:43:01 +0000 (13:43 +0100)]
Do not add a Proj to the schedule.

I wonder, how long this code was not executed.

11 years agoUse edges_reroute_except() instead of edges_reroute() to avoid fiddling with the...
Christoph Mallon [Sat, 3 Nov 2012 12:41:00 +0000 (13:41 +0100)]
Use edges_reroute_except() instead of edges_reroute() to avoid fiddling with the memory input of the inserted vfld.

11 years agoPanic when get_irn_Proj_for_mode() does not find a Proj.
Christoph Mallon [Sat, 3 Nov 2012 12:05:37 +0000 (13:05 +0100)]
Panic when get_irn_Proj_for_mode() does not find a Proj.

11 years agoRemove unnecessary tests.
Christoph Mallon [Sat, 3 Nov 2012 11:57:53 +0000 (12:57 +0100)]
Remove unnecessary tests.

- The src irn of a edge cannot be null.
- A node cannot be after itself in the schedule, so the later test will fail.

11 years agoSimplify collect_and_rewire_users(): Use get_edge_src_pos() instead of searching...
Christoph Mallon [Sat, 3 Nov 2012 11:56:26 +0000 (12:56 +0100)]
Simplify collect_and_rewire_users(): Use get_edge_src_pos() instead of searching for the operand.

11 years agoReplace x87_fxch_shuffle() + sched_add_before() by x87_create_fxch().
Christoph Mallon [Sat, 3 Nov 2012 11:22:18 +0000 (12:22 +0100)]
Replace x87_fxch_shuffle() + sched_add_before() by x87_create_fxch().

11 years agoSimplify inserting the fxchs in x87_shuffle().
Christoph Mallon [Sat, 3 Nov 2012 11:21:07 +0000 (12:21 +0100)]
Simplify inserting the fxchs in x87_shuffle().

Always inserting before the cf node results in the same order as first inserting before the cf node and then inserting after the last inserted node.

11 years agoPass the value to be pushed to x87_create_fpush().
Christoph Mallon [Sat, 3 Nov 2012 08:58:58 +0000 (09:58 +0100)]
Pass the value to be pushed to x87_create_fpush().

Before it was calculated from op_idx.

11 years agoCleanup and use C99.
Christoph Mallon [Sat, 3 Nov 2012 08:49:47 +0000 (09:49 +0100)]
Cleanup and use C99.

11 years agoPanic when get_call_result_proj() does not find the Proj.
Christoph Mallon [Sun, 4 Nov 2012 13:56:04 +0000 (14:56 +0100)]
Panic when get_call_result_proj() does not find the Proj.

11 years agoInline x87_alloc_state() into its only user.
Christoph Mallon [Sat, 3 Nov 2012 04:16:58 +0000 (05:16 +0100)]
Inline x87_alloc_state() into its only user.

11 years agoRemove unnecessary indirection for the empty x87 state.
Christoph Mallon [Fri, 2 Nov 2012 18:18:09 +0000 (19:18 +0100)]
Remove unnecessary indirection for the empty x87 state.

11 years agoRemove tos from x87_state.
Christoph Mallon [Fri, 2 Nov 2012 17:51:28 +0000 (18:51 +0100)]
Remove tos from x87_state.

It is the same as N_ia32_st_REGS - depth.

11 years agoSimplify x87_dump_stack().
Christoph Mallon [Fri, 2 Nov 2012 14:18:39 +0000 (15:18 +0100)]
Simplify x87_dump_stack().

11 years agoAdd the function x87_get_entry() to retrieve elements of the x87 stack.
Christoph Mallon [Fri, 2 Nov 2012 10:31:43 +0000 (11:31 +0100)]
Add the function x87_get_entry() to retrieve elements of the x87 stack.

11 years agoOnly copy the x87 state once per block.
Christoph Mallon [Thu, 1 Nov 2012 15:41:35 +0000 (16:41 +0100)]
Only copy the x87 state once per block.

Copy it before x87_kill_deads() instead of after it, so x87_kill_deads() does not need to conditionally copy it.

11 years agoSimplify x87 sim_Return().
Christoph Mallon [Thu, 1 Nov 2012 15:34:54 +0000 (16:34 +0100)]
Simplify x87 sim_Return().

Just flush the fp stack, only check for the correct number of fp values in debug builds.

11 years agoRemove stale and unused cruft from x87 simulator.
Christoph Mallon [Thu, 1 Nov 2012 15:31:44 +0000 (16:31 +0100)]
Remove stale and unused cruft from x87 simulator.

11 years agoPanic when the x87 simulator encounters and asm node with x87 constraints.
Christoph Mallon [Mon, 5 Nov 2012 17:04:56 +0000 (18:04 +0100)]
Panic when the x87 simulator encounters and asm node with x87 constraints.

11 years agoRemove stale comments.
Christoph Mallon [Sun, 4 Nov 2012 19:23:02 +0000 (20:23 +0100)]
Remove stale comments.

11 years agoRemove the unused function be_set_Copy_op().
Christoph Mallon [Sun, 4 Nov 2012 15:47:25 +0000 (16:47 +0100)]
Remove the unused function be_set_Copy_op().

11 years agoUse be_get_Copy_op().
Christoph Mallon [Sun, 4 Nov 2012 16:01:17 +0000 (17:01 +0100)]
Use be_get_Copy_op().

11 years agoCorrect name: OP(OP(x)) = x is involution, not idempotence.
Christoph Mallon [Sun, 4 Nov 2012 16:22:53 +0000 (17:22 +0100)]
Correct name: OP(OP(x)) = x is involution, not idempotence.

11 years agoAdd newline to avoid warning.
Christoph Mallon [Sat, 3 Nov 2012 07:46:23 +0000 (08:46 +0100)]
Add newline to avoid warning.

11 years agoSimplify test when to stop in push_through_perm().
Christoph Mallon [Wed, 31 Oct 2012 13:29:33 +0000 (14:29 +0100)]
Simplify test when to stop in push_through_perm().

11 years agoFix a performance bug in push_through_perm().
Christoph Mallon [Wed, 31 Oct 2012 10:24:37 +0000 (11:24 +0100)]
Fix a performance bug in push_through_perm().

Now more than one node can be pushed through a Perm.
After pushing the first node through a Perm, we next inspected the Perm itself (the new schedule predecessor of the moved node), which obviously cannot be pushed through itself.

11 years agoFix iterating all irgs in gc_irgs().
Christoph Mallon [Tue, 30 Oct 2012 07:10:40 +0000 (08:10 +0100)]
Fix iterating all irgs in gc_irgs().

Do not leave out the last (highest numbered) irg.

11 years agoFixed warning: Made global variable static.
Sebastian Buchwald [Mon, 29 Oct 2012 16:54:33 +0000 (17:54 +0100)]
Fixed warning: Made global variable static.

11 years agofix bad input register requirements
Matthias Braun [Mon, 29 Oct 2012 15:53:41 +0000 (16:53 +0100)]
fix bad input register requirements

some inputs had "no requirement" set instead of the correct one

11 years agobeverify: cleanup, use bool for ok/bad return value
Matthias Braun [Fri, 28 Sep 2012 08:42:24 +0000 (10:42 +0200)]
beverify: cleanup, use bool for ok/bad return value

11 years agobeverify: remove dominance check
Matthias Braun [Fri, 28 Sep 2012 08:36:04 +0000 (10:36 +0200)]
beverify: remove dominance check

irverify already checks the dominance property

11 years agofix output constraints of ia32_IJmp
Matthias Braun [Mon, 1 Oct 2012 16:38:52 +0000 (18:38 +0200)]
fix output constraints of ia32_IJmp

11 years agofix some missing register constraints
Matthias Braun [Sun, 30 Sep 2012 15:23:56 +0000 (17:23 +0200)]
fix some missing register constraints

11 years agoSet an input requirement for be_Spill, be_Reload frame input
Matthias Braun [Thu, 27 Sep 2012 17:11:49 +0000 (19:11 +0200)]
Set an input requirement for be_Spill, be_Reload frame input

(It was set to NULL in the past to support the STA-architecture, but
 that backend is not maintained anymore)

11 years agoshare common phi code, fix missing phi input reqs
Matthias Braun [Thu, 27 Sep 2012 17:10:46 +0000 (19:10 +0200)]
share common phi code, fix missing phi input reqs

11 years agoremove unnecessary options from beprefalloc
Matthias Braun [Mon, 3 Sep 2012 14:50:34 +0000 (16:50 +0200)]
remove unnecessary options from beprefalloc

They were used to selectively disable parts of the algorithm for
measurements in the paper. We now know that we always want them switched
on so remove the switches to simplify the code.

11 years agochange arch_XXX_out functions to use unsigned for pos
Matthias Braun [Mon, 3 Sep 2012 14:10:46 +0000 (16:10 +0200)]
change arch_XXX_out functions to use unsigned for pos

11 years agofix some memory leaks in beprefalloc
Matthias Braun [Mon, 29 Oct 2012 12:52:04 +0000 (13:52 +0100)]
fix some memory leaks in beprefalloc

11 years agodeallocate all datastructures when freeing a graph
Matthias Braun [Mon, 29 Oct 2012 12:51:57 +0000 (13:51 +0100)]
deallocate all datastructures when freeing a graph

11 years agomake remove_irp_irg API private
Matthias Braun [Mon, 29 Oct 2012 12:48:22 +0000 (13:48 +0100)]
make remove_irp_irg API private

Because otherwise we confuse users with free_ir_graph vs.
remove_irp_irg. Change it so that free_ir_graph also removes the graph
from the irp list.

11 years agoremove obsolete comment
Matthias Braun [Mon, 1 Oct 2012 14:58:49 +0000 (16:58 +0200)]
remove obsolete comment

11 years agoFix warnings.
Christoph Mallon [Sat, 27 Oct 2012 08:21:56 +0000 (10:21 +0200)]
Fix warnings.

Make function definitions prototype declarations.

11 years agoremoved old divmod handling
Christian Helmer [Fri, 26 Oct 2012 11:07:13 +0000 (13:07 +0200)]
removed old divmod handling

11 years agoremoved unimplemented extension
Christian Helmer [Thu, 4 Oct 2012 13:28:11 +0000 (15:28 +0200)]
removed unimplemented extension

11 years agofixed processing of mode_T nodes
Christian Helmer [Fri, 28 Sep 2012 14:38:12 +0000 (16:38 +0200)]
fixed processing of mode_T nodes

11 years agoStores also handled, optimize_node option implemented
Christian Helmer [Wed, 26 Sep 2012 20:32:24 +0000 (22:32 +0200)]
Stores also handled, optimize_node option implemented

11 years agodivmod handling broken and preliminary removed
Christian Helmer [Fri, 14 Sep 2012 16:21:29 +0000 (18:21 +0200)]
divmod handling broken and preliminary removed

11 years agoremoved unnecessary declarations
Christian Helmer [Fri, 14 Sep 2012 14:00:40 +0000 (16:00 +0200)]
removed unnecessary declarations

11 years agoclean up and comments
Christian Helmer [Fri, 14 Sep 2012 12:31:50 +0000 (14:31 +0200)]
clean up and comments

11 years agocleanup, constants fixed
Christian Helmer [Fri, 24 Aug 2012 14:51:34 +0000 (16:51 +0200)]
cleanup, constants fixed

11 years agofixed loads
Christian Helmer [Thu, 23 Aug 2012 18:43:03 +0000 (20:43 +0200)]
fixed loads

11 years agoused the same anti-leader to leader transfer in greedy check
Christian Helmer [Fri, 17 Aug 2012 15:38:19 +0000 (17:38 +0200)]
used the same anti-leader to leader transfer in greedy check

11 years agoprobably fixed loads, changed greedy condition
Christian Helmer [Wed, 15 Aug 2012 16:24:39 +0000 (18:24 +0200)]
probably fixed loads, changed greedy condition

11 years agoFixed high hoisting, additional comments, correct debug levels
Christian Helmer [Fri, 10 Aug 2012 14:27:12 +0000 (16:27 +0200)]
Fixed high hoisting, additional comments, correct debug levels

11 years agohoist high generates new node
Christian Helmer [Fri, 10 Aug 2012 09:31:04 +0000 (11:31 +0200)]
hoist high generates new node

11 years agomaybe fixed error where nontranslated expression needed to be translated during insert
Christian Helmer [Mon, 6 Aug 2012 16:32:24 +0000 (18:32 +0200)]
maybe fixed error where nontranslated expression needed to be translated during insert

11 years agoGVN fixes
Christian Helmer [Tue, 31 Jul 2012 15:33:38 +0000 (17:33 +0200)]
GVN fixes

11 years agofixed leader problem
Christian Helmer [Fri, 27 Jul 2012 13:17:44 +0000 (15:17 +0200)]
fixed leader problem

11 years agoreverted antic_in
Christian Helmer [Wed, 25 Jul 2012 15:43:58 +0000 (17:43 +0200)]
reverted antic_in

11 years agobetter available constant handling
Christian Helmer [Fri, 20 Jul 2012 16:26:25 +0000 (18:26 +0200)]
better available constant handling

11 years agoDifferent management of antic sets.
Christian Helmer [Thu, 19 Jul 2012 17:00:31 +0000 (19:00 +0200)]
Different management of antic sets.

11 years agoAdded link field for arbitrary data to ir_valueset elements.
Christian Helmer [Thu, 19 Jul 2012 16:56:38 +0000 (18:56 +0200)]
Added link field for arbitrary data to ir_valueset elements.

11 years agoimplemented true GVN
Christian Helmer [Wed, 18 Jul 2012 15:17:32 +0000 (17:17 +0200)]
implemented true GVN

11 years agofixed bug where projections ended up in the wrong blocks
Christian Helmer [Fri, 25 May 2012 14:01:49 +0000 (16:01 +0200)]
fixed bug where projections ended up in the wrong blocks

11 years agoswitch_lowerer: cast to backend specified Switch mode
Matthias Braun [Thu, 25 Oct 2012 18:49:56 +0000 (20:49 +0200)]
switch_lowerer: cast to backend specified Switch mode

This should fix all cases of 64bit switches

11 years agoremove no-out_of_bounds option from lower_switch
Matthias Braun [Thu, 25 Oct 2012 18:16:28 +0000 (20:16 +0200)]
remove no-out_of_bounds option from lower_switch

noone was using it anyway

11 years agochange lower_switch to work on tarvals instead of int
Matthias Braun [Thu, 25 Oct 2012 17:09:40 +0000 (19:09 +0200)]
change lower_switch to work on tarvals instead of int

11 years agoSwitch nodes may have dw inputs, without outputs
Matthias Braun [Wed, 24 Oct 2012 16:43:03 +0000 (18:43 +0200)]
Switch nodes may have dw inputs, without outputs

switch with double-word input leads to panic, but still better than
obscure verifier errors.

11 years agoavoid -pedantic warning
Matthias Braun [Wed, 24 Oct 2012 16:21:24 +0000 (18:21 +0200)]
avoid -pedantic warning

11 years agomake statev API public
Matthias Braun [Sun, 14 Oct 2012 20:06:30 +0000 (22:06 +0200)]
make statev API public

11 years agoremove irg_phase_state, use IR_GRAPH_CONSTRAINT instead
Matthias Braun [Mon, 1 Oct 2012 14:51:40 +0000 (16:51 +0200)]
remove irg_phase_state, use IR_GRAPH_CONSTRAINT instead

11 years agoirverify: remove load/store from entity verification
Matthias Braun [Mon, 1 Oct 2012 14:25:39 +0000 (16:25 +0200)]
irverify: remove load/store from entity verification

It was only a valid check in strongly typed unoptimized languages, not
much value in a firm-graph.

11 years agolocalopt stuff for const-code irg
Matthias Braun [Sun, 14 Oct 2012 20:07:02 +0000 (22:07 +0200)]
localopt stuff for const-code irg

11 years agorework timer API
Matthias Braun [Sun, 14 Oct 2012 20:06:03 +0000 (22:06 +0200)]
rework timer API

11 years agomove get_irn_edge_kind to internal API
Matthias Braun [Sun, 14 Oct 2012 14:55:12 +0000 (16:55 +0200)]
move get_irn_edge_kind to internal API

11 years agoreorgranize method properties
Matthias Braun [Tue, 25 Sep 2012 13:17:03 +0000 (15:17 +0200)]
reorgranize method properties

- do not record properties on irgs anymore, always do it on the irgs
  entity; entity properties have to be a superset of the entities method
  type properties.
- Remove special irg_inline_property and use mtp_additional_properties
  instead

11 years agoalways dump additional method props
Matthias Braun [Tue, 25 Sep 2012 10:57:26 +0000 (12:57 +0200)]
always dump additional method props

11 years agoopt_funccall: cleanup, use C99
Matthias Braun [Tue, 25 Sep 2012 10:09:41 +0000 (12:09 +0200)]
opt_funccall: cleanup, use C99

Also removes some debugging output to simplify the code

11 years agoopt_funccall: remove outdated/unused OO optimisations
Matthias Braun [Tue, 25 Sep 2012 08:56:10 +0000 (10:56 +0200)]
opt_funccall: remove outdated/unused OO optimisations

11 years agoia32: cleanup handling of 8/16bit operations
Matthias Braun [Tue, 25 Sep 2012 08:54:44 +0000 (10:54 +0200)]
ia32: cleanup handling of 8/16bit operations

This also fixes backend/sign_bit.c

11 years agofix a bunch of warnings reported by clang analyzer
Matthias Braun [Fri, 21 Sep 2012 11:54:25 +0000 (13:54 +0200)]
fix a bunch of warnings reported by clang analyzer

11 years agoadd some missing cases for copy_const_value
Matthias Braun [Sun, 14 Oct 2012 20:22:22 +0000 (22:22 +0200)]
add some missing cases for copy_const_value

11 years agofix comdat emitting on macho
Matthias Braun [Fri, 21 Sep 2012 11:38:25 +0000 (13:38 +0200)]
fix comdat emitting on macho

11 years agoRemove unused map_Abs().
Christoph Mallon [Wed, 24 Oct 2012 05:23:06 +0000 (07:23 +0200)]
Remove unused map_Abs().

11 years agoRemove duplicate macro.
Christoph Mallon [Wed, 24 Oct 2012 05:15:27 +0000 (07:15 +0200)]
Remove duplicate macro.

11 years agoDon't set copy_attr_func to NULL for nodes without attributes.
Julian Oppermann [Tue, 23 Oct 2012 13:27:17 +0000 (15:27 +0200)]
Don't set copy_attr_func to NULL for nodes without attributes.

11 years agoProperly specify alternate AM in the ia32_IJmp emit clause.
Christoph Mallon [Mon, 22 Oct 2012 19:14:42 +0000 (21:14 +0200)]
Properly specify alternate AM in the ia32_IJmp emit clause.

When hard-coding the *, invalid assembler gets emitted if an immediate ends up as ia32_IJmp operand.

11 years agoPerform switch lowering before double-word lowering.
Sebastian Buchwald [Fri, 19 Oct 2012 12:30:13 +0000 (14:30 +0200)]
Perform switch lowering before double-word lowering.

This fixes gcc/pr37285.c.

11 years agoUpdate documentation.
Christoph Mallon [Thu, 18 Oct 2012 07:10:47 +0000 (09:10 +0200)]
Update documentation.

11 years agoFix doc typo.
Andreas Seltenreich [Mon, 15 Oct 2012 09:43:58 +0000 (11:43 +0200)]
Fix doc typo.

11 years agoExtended public backend API.
Manuel Mohr [Fri, 14 Sep 2012 15:05:34 +0000 (17:05 +0200)]
Extended public backend API.

Added some additional functions that allow direct access to some fields
of the backend params struct.  These functions avoid struct type,
thereby making interfacing with the jFirm library easier.