diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2012-08-15 22:15:44 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2012-08-15 22:15:44 +0000 |
commit | 66b038ce225f80bd7ca5b1af0e9b7be30f9171ca (patch) | |
tree | 64c0020bb4381a06037a1c269adb806f53cdad42 /gcc | |
parent | 0b2d443bef10e972db37d28d4626ab8dbbf4abcc (diff) | |
download | gcc-66b038ce225f80bd7ca5b1af0e9b7be30f9171ca.zip gcc-66b038ce225f80bd7ca5b1af0e9b7be30f9171ca.tar.gz gcc-66b038ce225f80bd7ca5b1af0e9b7be30f9171ca.tar.bz2 |
spu.c: Include "cfgloop.h".
* config/spu/spu.c: Include "cfgloop.h".
(spu_machine_dependent_reorg): Call loop_optimizer_init and
loop_optimizer_finalize. Use bb_loop_depth instead of loop_depth.
Directly compare loop_father values where appropriate.
* config/spu/t-spu-elf (spu.o): Update dependencies.
From-SVN: r190421
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/spu/spu.c | 18 | ||||
-rw-r--r-- | gcc/config/spu/t-spu-elf | 2 |
3 files changed, 21 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eba6d75..12cecd5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2012-08-15 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> + + * config/spu/spu.c: Include "cfgloop.h". + (spu_machine_dependent_reorg): Call loop_optimizer_init and + loop_optimizer_finalize. Use bb_loop_depth instead of loop_depth. + Directly compare loop_father values where appropriate. + * config/spu/t-spu-elf (spu.o): Update dependencies. + 2012-08-15 H.J. Lu <hongjiu.lu@intel.com> * Makefile.in (tree-cfg.o): Also depend on $(TARGET_H). diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c index 2d5405d..51e0dfb 100644 --- a/gcc/config/spu/spu.c +++ b/gcc/config/spu/spu.c @@ -53,6 +53,7 @@ #include "timevar.h" #include "df.h" #include "dumpfile.h" +#include "cfgloop.h" /* Builtin types, data and prototypes. */ @@ -2458,6 +2459,10 @@ spu_machine_dependent_reorg (void) in_spu_reorg = 1; compute_bb_for_insn (); + /* (Re-)discover loops so that bb->loop_father can be used + in the analysis below. */ + loop_optimizer_init (AVOID_CFG_MODIFICATIONS); + compact_blocks (); spu_bb_info = @@ -2562,14 +2567,13 @@ spu_machine_dependent_reorg (void) fallthru block. This catches the cases when it is a simple loop or when there is an initial branch into the loop. */ if (prev && (loop_exit || simple_loop) - && prev->loop_depth <= bb->loop_depth) + && bb_loop_depth (prev) <= bb_loop_depth (bb)) prop = prev; /* If there is only one adjacent predecessor. Don't propagate - outside this loop. This loop_depth test isn't perfect, but - I'm not sure the loop_father member is valid at this point. */ + outside this loop. */ else if (prev && single_pred_p (bb) - && prev->loop_depth == bb->loop_depth) + && prev->loop_father == bb->loop_father) prop = prev; /* If this is the JOIN block of a simple IF-THEN then @@ -2578,7 +2582,7 @@ spu_machine_dependent_reorg (void) && EDGE_COUNT (bb->preds) == 2 && EDGE_COUNT (prev->preds) == 1 && EDGE_PRED (prev, 0)->src == prev2 - && prev2->loop_depth == bb->loop_depth + && prev2->loop_father == bb->loop_father && GET_CODE (branch_target) != REG) prop = prev; @@ -2600,7 +2604,7 @@ spu_machine_dependent_reorg (void) if (dump_file) fprintf (dump_file, "propagate from %i to %i (loop depth %i) " "for %i (loop_exit %i simple_loop %i dist %i)\n", - bb->index, prop->index, bb->loop_depth, + bb->index, prop->index, bb_loop_depth (bb), INSN_UID (branch), loop_exit, simple_loop, branch_addr - INSN_ADDRESSES (INSN_UID (bbend))); @@ -2657,6 +2661,8 @@ spu_machine_dependent_reorg (void) spu_var_tracking (); + loop_optimizer_finalize (); + free_bb_for_insn (); in_spu_reorg = 0; diff --git a/gcc/config/spu/t-spu-elf b/gcc/config/spu/t-spu-elf index 866d910..83a1619 100644 --- a/gcc/config/spu/t-spu-elf +++ b/gcc/config/spu/t-spu-elf @@ -23,7 +23,7 @@ spu.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ real.h insn-config.h conditions.h insn-attr.h flags.h $(RECOG_H) \ $(OBSTACK_H) $(TREE_H) $(EXPR_H) $(OPTABS_H) except.h function.h \ output.h $(BASIC_BLOCK_H) $(GGC_H) $(HASHTAB_H) \ - $(TM_P_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h reload.h \ + $(TM_P_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h reload.h $(CFGLOOP_H) \ $(srcdir)/config/spu/spu-protos.h \ $(srcdir)/config/spu/spu-builtins.def |