libfirm
12 years agosparc: improve delay slot picking
Matthias Braun [Thu, 13 Oct 2011 15:48:16 +0000 (17:48 +0200)]
sparc: improve delay slot picking

12 years agobepeephole: make assert about dominance less strict
Matthias Braun [Mon, 17 Oct 2011 13:57:57 +0000 (15:57 +0200)]
bepeephole: make assert about dominance less strict

12 years agochange strange indentation
Matthias Braun [Thu, 13 Oct 2011 15:48:00 +0000 (17:48 +0200)]
change strange indentation

12 years agoXor without address mode is commutative.
Sebastian Buchwald [Mon, 17 Oct 2011 11:03:18 +0000 (13:03 +0200)]
Xor without address mode is commutative.

This fixes backend/builtin_parityl.c and backend/builtin_parityll.c.

12 years agoAlso track extended live ranges.
Sebastian Buchwald [Mon, 17 Oct 2011 10:56:23 +0000 (12:56 +0200)]
Also track extended live ranges.

If the peephole replaced the current node by another node
the corresponding value is live before the current node.

This fixes x86code/flags.c.

12 years agoClean up code.
Sebastian Buchwald [Thu, 13 Oct 2011 12:43:02 +0000 (14:43 +0200)]
Clean up code.

12 years agoFixed typo.
Sebastian Buchwald [Thu, 13 Oct 2011 12:42:47 +0000 (14:42 +0200)]
Fixed typo.

12 years agoLower double word builtins.
Sebastian Buchwald [Tue, 4 Oct 2011 19:22:56 +0000 (21:22 +0200)]
Lower double word builtins.

12 years agoFixed some typos.
Sebastian Buchwald [Mon, 3 Oct 2011 18:34:30 +0000 (20:34 +0200)]
Fixed some typos.

12 years agosparc: prefer andn,orn,xorn when they lead to smaller constants
Matthias Braun [Tue, 11 Oct 2011 13:20:25 +0000 (15:20 +0200)]
sparc: prefer andn,orn,xorn when they lead to smaller constants

(see testsuite/backend/sparc_notconsts.c for an example)

12 years agosparc: peephole - fold copy into restore
Matthias Braun [Sat, 1 Oct 2011 03:11:34 +0000 (05:11 +0200)]
sparc: peephole - fold copy into restore

12 years agosparc: Corrected sp-relative access warning.
Manuel Mohr [Wed, 28 Sep 2011 14:08:21 +0000 (16:08 +0200)]
sparc:  Corrected sp-relative access warning.

12 years agosparc: Restore accidentally deleted assert.
Manuel Mohr [Wed, 28 Sep 2011 12:55:03 +0000 (14:55 +0200)]
sparc:  Restore accidentally deleted assert.

12 years agoFixed local optimization.
Sebastian Buchwald [Wed, 28 Sep 2011 04:26:13 +0000 (06:26 +0200)]
Fixed local optimization.

The transformation (a << c1) | c2 => (a | (c2 >> c1)) << c1
is only valid if the lower bits of c2 are clean.

This fixes opt/pr37102.c.

12 years agosparc: Warn if trying to emit stack relative Lds/Sts with small offsets.
Manuel Mohr [Tue, 27 Sep 2011 12:36:35 +0000 (14:36 +0200)]
sparc:  Warn if trying to emit stack relative Lds/Sts with small offsets.

12 years agosparc: Lower CopyB nodes before lowering double words.
Manuel Mohr [Tue, 27 Sep 2011 10:58:37 +0000 (12:58 +0200)]
sparc:  Lower CopyB nodes before lowering double words.

12 years agosparc: attempt to fix stack alignment/address for omit-fp again
Matthias Braun [Tue, 27 Sep 2011 13:36:14 +0000 (15:36 +0200)]
sparc: attempt to fix stack alignment/address for omit-fp again

12 years agosparc: fix wrong stack-offset in omit-fp commits
Matthias Braun [Tue, 27 Sep 2011 12:21:45 +0000 (14:21 +0200)]
sparc: fix wrong stack-offset in omit-fp commits

12 years agosparc: va_arg functions may not use omit-fp
Matthias Braun [Tue, 27 Sep 2011 12:19:30 +0000 (14:19 +0200)]
sparc: va_arg functions may not use omit-fp

12 years agosparc: read mode_gp from regclass instead of hardcoding mode_Iu
Matthias Braun [Mon, 26 Sep 2011 09:07:46 +0000 (11:07 +0200)]
sparc: read mode_gp from regclass instead of hardcoding mode_Iu

12 years agofix frame_alloc_area not setting a type size
Matthias Braun [Fri, 23 Sep 2011 12:23:00 +0000 (14:23 +0200)]
fix frame_alloc_area not setting a type size

12 years agoinclude backend headers without "../"
Matthias Braun [Fri, 23 Sep 2011 12:05:12 +0000 (14:05 +0200)]
include backend headers without "../"

This was an odd convention from the past, there's no need for it
anymore.

12 years agoremove old/unused XXX_transform_env_t structs
Matthias Braun [Fri, 23 Sep 2011 11:44:54 +0000 (13:44 +0200)]
remove old/unused XXX_transform_env_t structs

12 years agosparc: mark has_delay_slot as node flag
Matthias Braun [Fri, 23 Sep 2011 09:33:23 +0000 (11:33 +0200)]
sparc: mark has_delay_slot as node flag

12 years agoAdded option to prevent creation of misaligned loads/stores during CopyB lowering.
Manuel Mohr [Tue, 27 Sep 2011 08:05:39 +0000 (10:05 +0200)]
Added option to prevent creation of misaligned loads/stores during CopyB lowering.

12 years agoremove warning
Andreas Zwinkau [Mon, 26 Sep 2011 08:37:06 +0000 (10:37 +0200)]
remove warning

12 years agoEnqueue Phi nodes to reach fixpoint.
Sebastian Buchwald [Fri, 23 Sep 2011 13:25:20 +0000 (15:25 +0200)]
Enqueue Phi nodes to reach fixpoint.

12 years agoFixed typos.
Sebastian Buchwald [Mon, 18 Jul 2011 16:16:24 +0000 (18:16 +0200)]
Fixed typos.

12 years agoConsistently use new function to create compilerlib function entities.
Manuel Mohr [Fri, 23 Sep 2011 10:49:38 +0000 (12:49 +0200)]
Consistently use new function to create compilerlib function entities.

12 years agoAdded callback mechanism to determine compilerlib function names.
Manuel Mohr [Thu, 22 Sep 2011 14:34:55 +0000 (16:34 +0200)]
Added callback mechanism to determine compilerlib function names.

12 years agoconvenience function to see if mux gets optimized away
Matthias Braun [Thu, 22 Sep 2011 14:35:56 +0000 (16:35 +0200)]
convenience function to see if mux gets optimized away

backends can use this to allow all mux nodes which get optimized away by
the middleend anyway.
This fixes abs handling on sparc.

12 years agosimplify transform_node_Mux by using is_single_bit
Matthias Braun [Thu, 22 Sep 2011 12:56:22 +0000 (14:56 +0200)]
simplify transform_node_Mux by using is_single_bit

12 years agocleanup in firm_types.h
Matthias Braun [Thu, 22 Sep 2011 12:34:39 +0000 (14:34 +0200)]
cleanup in firm_types.h

12 years agokill deprecated firm_parameter_t interface
Matthias Braun [Thu, 22 Sep 2011 12:29:47 +0000 (14:29 +0200)]
kill deprecated firm_parameter_t interface

12 years agoremove old+unused interval_analysis
Matthias Braun [Thu, 22 Sep 2011 12:23:32 +0000 (14:23 +0200)]
remove old+unused interval_analysis

12 years agoremove old+unused execution_frequency/field_temperature
Matthias Braun [Thu, 22 Sep 2011 12:21:02 +0000 (14:21 +0200)]
remove old+unused execution_frequency/field_temperature

12 years agocleanup comments in public headers
Matthias Braun [Thu, 22 Sep 2011 12:06:04 +0000 (14:06 +0200)]
cleanup comments in public headers

12 years agoremove old+unused structure analysis
Matthias Braun [Thu, 22 Sep 2011 11:51:48 +0000 (13:51 +0200)]
remove old+unused structure analysis

12 years agoremove old+unused rta code
Matthias Braun [Thu, 22 Sep 2011 11:49:02 +0000 (13:49 +0200)]
remove old+unused rta code

12 years agosparc: Improve handling of MemPerm nodes.
Manuel Mohr [Wed, 21 Sep 2011 13:31:16 +0000 (15:31 +0200)]
sparc:  Improve handling of MemPerm nodes.

12 years agobackend always expects outedges, assure them after place_code, optimize_graph_df
Matthias Braun [Wed, 21 Sep 2011 11:03:16 +0000 (13:03 +0200)]
backend always expects outedges, assure them after place_code, optimize_graph_df

12 years agorespect ir_dump_flag_loop
Matthias Braun [Wed, 21 Sep 2011 10:46:49 +0000 (12:46 +0200)]
respect ir_dump_flag_loop

(a recent commit broke it)

12 years agoMake local Phi optimization robust against Bads.
Sebastian Buchwald [Tue, 20 Sep 2011 11:15:40 +0000 (13:15 +0200)]
Make local Phi optimization robust against Bads.

12 years agocfopt: code cleanup
Matthias Braun [Mon, 19 Sep 2011 05:03:06 +0000 (07:03 +0200)]
cfopt: code cleanup

12 years agoeliminate ip_outs_state and trouts_state
Matthias Braun [Sun, 18 Sep 2011 15:40:41 +0000 (17:40 +0200)]
eliminate ip_outs_state and trouts_state

Noone is really using these informations at the moment and they weren't
correctly invalidated anyway.

12 years agouse IR_GRAPH_STATE instead of irg_extblk_info_state
Matthias Braun [Sun, 18 Sep 2011 15:31:21 +0000 (17:31 +0200)]
use IR_GRAPH_STATE instead of irg_extblk_info_state

12 years agoadd some missing tests to the node_cmp_attr functions
Matthias Braun [Sun, 18 Sep 2011 15:12:03 +0000 (17:12 +0200)]
add some missing tests to the node_cmp_attr functions

12 years agosparc: do not emit the node comment twice for Ba
Matthias Braun [Sat, 17 Sep 2011 15:51:07 +0000 (17:51 +0200)]
sparc: do not emit the node comment twice for Ba

12 years agosparc: dont emit unnecarry block labels
Matthias Braun [Sat, 17 Sep 2011 15:49:45 +0000 (17:49 +0200)]
sparc: dont emit unnecarry block labels

12 years agoadd missing keeps after rematerializing nodes
Matthias Braun [Sat, 17 Sep 2011 11:23:41 +0000 (13:23 +0200)]
add missing keeps after rematerializing nodes

12 years agolower_mode_b: handle BadB
Matthias Braun [Fri, 16 Sep 2011 17:19:04 +0000 (19:19 +0200)]
lower_mode_b: handle BadB

12 years agodo not create ConstB nodes in GRAPH_STATE_MODEB_LOWERED
Matthias Braun [Fri, 16 Sep 2011 14:31:32 +0000 (16:31 +0200)]
do not create ConstB nodes in GRAPH_STATE_MODEB_LOWERED

12 years agoremove unreachable_code/bads after normalize_n_returns
Matthias Braun [Fri, 16 Sep 2011 13:56:32 +0000 (15:56 +0200)]
remove unreachable_code/bads after normalize_n_returns

12 years agonormalize_n_returns does produce unreachable code and invalidates other stuff
Matthias Braun [Fri, 16 Sep 2011 13:52:37 +0000 (15:52 +0200)]
normalize_n_returns does produce unreachable code and invalidates other stuff

12 years agoclear no_unreachable_code state when optimizing Cond/Projs
Matthias Braun [Fri, 16 Sep 2011 13:56:10 +0000 (15:56 +0200)]
clear no_unreachable_code state when optimizing Cond/Projs

12 years agochange unreachable code elmination to the simpler remove links into unreachable code...
Matthias Braun [Fri, 16 Sep 2011 13:54:00 +0000 (15:54 +0200)]
change unreachable code elmination to the simpler remove links into unreachable code scheme

12 years agodump graph state
Matthias Braun [Fri, 16 Sep 2011 13:52:56 +0000 (15:52 +0200)]
dump graph state

12 years agochange global optdesc declarations to static
Matthias Braun [Fri, 16 Sep 2011 12:06:09 +0000 (14:06 +0200)]
change global optdesc declarations to static

some were missing anyway and nobody is using the global declarations anyway

12 years agoremove loopinfo stuff and exclusively use IR_GRAPH_STATE_CONSISTENT_LOOPINFO
Matthias Braun [Fri, 16 Sep 2011 11:56:54 +0000 (13:56 +0200)]
remove loopinfo stuff and exclusively use IR_GRAPH_STATE_CONSISTENT_LOOPINFO

12 years agofix warning because of now ignored invalidate flag
Matthias Braun [Fri, 16 Sep 2011 11:51:26 +0000 (13:51 +0200)]
fix warning because of now ignored invalidate flag

12 years agoremove broken-for-verifier flag
Matthias Braun [Fri, 16 Sep 2011 11:26:23 +0000 (13:26 +0200)]
remove broken-for-verifier flag

12 years agorename NO_BAD_BLOCKS to NO_BADS, remove unnecessary implication from opt_manage
Matthias Braun [Fri, 16 Sep 2011 11:22:00 +0000 (13:22 +0200)]
rename NO_BAD_BLOCKS to NO_BADS, remove unnecessary implication from opt_manage

12 years agocleanup/fix optimize_graph_df flag handling
Matthias Braun [Fri, 16 Sep 2011 09:28:33 +0000 (11:28 +0200)]
cleanup/fix optimize_graph_df flag handling

12 years agosimplify code
Matthias Braun [Thu, 15 Sep 2011 15:19:48 +0000 (17:19 +0200)]
simplify code

12 years agowe must clear block+phi-node links
Matthias Braun [Thu, 15 Sep 2011 15:19:35 +0000 (17:19 +0200)]
we must clear block+phi-node links

12 years agotransform_node_Block does not produce bad blocks anyway
Matthias Braun [Thu, 15 Sep 2011 13:47:16 +0000 (15:47 +0200)]
transform_node_Block does not produce bad blocks anyway

12 years agodo not use custom copy without custom attributes
Matthias Braun [Thu, 15 Sep 2011 13:49:03 +0000 (15:49 +0200)]
do not use custom copy without custom attributes

12 years agosparc: fix spec, it's called dump_func not dump_node
Matthias Braun [Sat, 17 Sep 2011 10:54:33 +0000 (12:54 +0200)]
sparc: fix spec, it's called dump_func not dump_node

12 years agoTurn off CSE when creating Projs during double word lowering.
Manuel Mohr [Mon, 19 Sep 2011 09:30:34 +0000 (11:30 +0200)]
Turn off CSE when creating Projs during double word lowering.

12 years agofix warning
Andreas Zwinkau [Fri, 16 Sep 2011 13:46:14 +0000 (15:46 +0200)]
fix warning

12 years agoDocumentation: why kill unreachable code between localopts
Andreas Zwinkau [Fri, 16 Sep 2011 11:08:44 +0000 (13:08 +0200)]
Documentation: why kill unreachable code between localopts

12 years agoPerform KeepAlive housekeeping after each opt
Andreas Zwinkau [Fri, 16 Sep 2011 10:59:53 +0000 (12:59 +0200)]
Perform KeepAlive housekeeping after each opt

12 years agoDo not replace Bad predecessors by new Bads in transform_node_Block() and transform_n...
Christoph Mallon [Fri, 16 Sep 2011 08:55:01 +0000 (10:55 +0200)]
Do not replace Bad predecessors by new Bads in transform_node_Block() and transform_node_Phi().

12 years agodocumentation for graph state flags
Andreas Zwinkau [Fri, 16 Sep 2011 08:51:49 +0000 (10:51 +0200)]
documentation for graph state flags

12 years agoReplace magic 4 by SPARC_REGISTER_SIZE.
Christoph Mallon [Fri, 16 Sep 2011 05:55:29 +0000 (07:55 +0200)]
Replace magic 4 by SPARC_REGISTER_SIZE.

12 years agoUse SPARC_STACK_ALIGNMENT and round_up2() instead of magic numbers and calculations.
Christoph Mallon [Fri, 16 Sep 2011 05:48:48 +0000 (07:48 +0200)]
Use SPARC_STACK_ALIGNMENT and round_up2() instead of magic numbers and calculations.

12 years agosparc: Keep stack pointer 8 bytes aligned when generating code for MemPerm.
Manuel Mohr [Thu, 15 Sep 2011 14:06:13 +0000 (16:06 +0200)]
sparc: Keep stack pointer 8 bytes aligned when generating code for MemPerm.

12 years agoFix cfopt
Andreas Zwinkau [Thu, 15 Sep 2011 12:09:41 +0000 (14:09 +0200)]
Fix cfopt

The cfopt itself can handle unreachable code,
but it transforms it in a way that makes the verifier unhappy.

12 years agoFixed inconsistent uses of DEBUG_ONLY.
Sebastian Buchwald [Thu, 15 Sep 2011 11:45:56 +0000 (13:45 +0200)]
Fixed inconsistent uses of DEBUG_ONLY.

12 years agoFix DEBUG_ONLY use
Andreas Zwinkau [Thu, 15 Sep 2011 11:23:39 +0000 (13:23 +0200)]
Fix DEBUG_ONLY use

12 years agowrapping stuff in DEBUG_ONLY
Andreas Zwinkau [Thu, 15 Sep 2011 10:41:38 +0000 (12:41 +0200)]
wrapping stuff in DEBUG_ONLY

12 years agoNo unreachable code in backend
Andreas Zwinkau [Thu, 15 Sep 2011 09:28:51 +0000 (11:28 +0200)]
No unreachable code in backend

12 years agoInsert declarations to remove cparser warnings
Andreas Zwinkau [Thu, 15 Sep 2011 08:43:56 +0000 (10:43 +0200)]
Insert declarations to remove cparser warnings

12 years agoAdd licence header and documentation to opt_manage.h
Andreas Zwinkau [Thu, 15 Sep 2011 08:32:19 +0000 (10:32 +0200)]
Add licence header and documentation to opt_manage.h

12 years agooops, forgot to add a file
Matthias Braun [Thu, 15 Sep 2011 10:38:41 +0000 (12:38 +0200)]
oops, forgot to add a file

12 years agolower_mode_b: refactoring, make it more robust
Matthias Braun [Thu, 15 Sep 2011 07:51:40 +0000 (09:51 +0200)]
lower_mode_b: refactoring, make it more robust

- Make API private as it should only be called by backends
- Let ia32 backend create special ia32_Set nodes instead of relying
  on muxes which must not be touched anymore
- Does not create ConvB nodes anymore but instead produces the Cmp
  directly. (All backends did this anyway during code-selection so I was
  able to leave this case out code-selection)
- First collect nodes to lower, then lower them. This avoids robustness
  problems when transforming the graph while at the same time walking
  it.

12 years agosome cleanups for middleend node creation in backends
Matthias Braun [Tue, 13 Sep 2011 14:50:59 +0000 (16:50 +0200)]
some cleanups for middleend node creation in backends

Some backends create nodes in their lower_for_target phases already.
These nodes are placeholders for real backend nodes later, in contrast
they do not have register requirements or backend attributes. Simplified
this by allowing custom dumpers for them and leaving out the backend
node structs.

12 years agoWe can only optimize one CopyB for each return value.
Sebastian Buchwald [Thu, 15 Sep 2011 07:13:41 +0000 (09:13 +0200)]
We can only optimize one CopyB for each return value.

This fixes opt/fehler202.c.

12 years agoMinor indentation fix.
Manuel Mohr [Wed, 14 Sep 2011 12:48:53 +0000 (14:48 +0200)]
Minor indentation fix.

12 years agoMerge branch 'opt_manage'
Andreas Zwinkau [Wed, 14 Sep 2011 11:40:07 +0000 (13:40 +0200)]
Merge branch 'opt_manage'

This is a merge, because it should be considered as a single commit
and libFirm might be broken between the various commits of the branch.
However, there are so many changes, that i do not want to squash
them all into one mega-commit.

12 years agoRemove entity_usage_state attribute
Andreas Zwinkau [Wed, 14 Sep 2011 11:00:07 +0000 (13:00 +0200)]
Remove entity_usage_state attribute

12 years agoRemove dom_state and pdom_state attributes
Andreas Zwinkau [Wed, 14 Sep 2011 09:28:59 +0000 (11:28 +0200)]
Remove dom_state and pdom_state attributes

12 years agoRemove outs_state attribute
Andreas Zwinkau [Tue, 13 Sep 2011 11:08:17 +0000 (13:08 +0200)]
Remove outs_state attribute

API change: removes set_irg_outs_inconsistent and get_irg_outs_state
Use set_irg_state and is_irg_state instead!

12 years agoAPI to enable dumping
Andreas Zwinkau [Thu, 8 Sep 2011 12:25:47 +0000 (14:25 +0200)]
API to enable dumping

12 years agoRemoved IR_GRAPH_STATE_BAD_BLOCK symbol
Andreas Zwinkau [Wed, 7 Sep 2011 12:06:08 +0000 (14:06 +0200)]
Removed IR_GRAPH_STATE_BAD_BLOCK symbol

12 years agoconvert opts to use the opt_manage framework
Andreas Zwinkau [Fri, 2 Sep 2011 11:59:47 +0000 (13:59 +0200)]
convert opts to use the opt_manage framework

Converted: ifconv, boolopt, combo, fpvrp, ldst, code placement,
jumpthreading, deconv, parallelize mem, loop, scalar replacement,
cfopt.

12 years agointroduce opt_manage framework
Andreas Zwinkau [Wed, 7 Sep 2011 12:59:03 +0000 (14:59 +0200)]
introduce opt_manage framework

This is a basic implementation of http://libfirm.org/PhaseManagement

Introduces remove_unreachable_blocks as an extra API function,
which does a subset of optimize_graph_df.

12 years agointroduce remove_unreachable_blocks
Andreas Zwinkau [Thu, 8 Sep 2011 10:56:39 +0000 (12:56 +0200)]
introduce remove_unreachable_blocks

12 years agoRemove dead assignment
Andreas Zwinkau [Wed, 14 Sep 2011 09:01:55 +0000 (11:01 +0200)]
Remove dead assignment

Cheering up Tron ;)

12 years agobeabi: no special treatment of returns_twice
Matthias Braun [Tue, 13 Sep 2011 12:19:26 +0000 (14:19 +0200)]
beabi: no special treatment of returns_twice

returns_twice handling was broken in the ia32-backend (the only real
beabi user) for a long time now. Just noone noticed because our
frontends lacked the special treatment to set the flag correctly.
Turned out setjmp/longjmp on ia32 save/restore the registers anyway
so not doing anything is fine here.