aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@redhat.com>2005-04-04 19:42:51 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2005-04-04 19:42:51 +0000
commit39b4020ca1c28fb1a27813920bda7cdec3bc77f4 (patch)
tree4998e29147da8a4841f600c5183c7ec26e00e07a /gcc
parent251e2ff23fc7a7c7a319dee3fa6acac3d8c2642a (diff)
downloadgcc-39b4020ca1c28fb1a27813920bda7cdec3bc77f4.zip
gcc-39b4020ca1c28fb1a27813920bda7cdec3bc77f4.tar.gz
gcc-39b4020ca1c28fb1a27813920bda7cdec3bc77f4.tar.bz2
Makefile.in (tree-ssa-loop-ivopts.o): Depend on langhooks.h.
* Makefile.in (tree-ssa-loop-ivopts.o): Depend on langhooks.h. * tree-ssa-loop-ivopts.c: Include langhooks.h. (add_standard_iv_candidates_for_size): New function, extracting code from add_standard_iv_candidates and parameterizing it by type size. (add_standard_iv_candidates): Use add_standard_iv_candidates_for_size. From-SVN: r97571
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/tree-ssa-loop-ivopts.c28
3 files changed, 26 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 20e9b39..846f6f2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2004-04-04 Richard Sandiford <rsandifo@redhat.com>
+ * Makefile.in (tree-ssa-loop-ivopts.o): Depend on langhooks.h.
+ * tree-ssa-loop-ivopts.c: Include langhooks.h.
+ (add_standard_iv_candidates_for_size): New function, extracting code
+ from add_standard_iv_candidates and parameterizing it by type size.
+ (add_standard_iv_candidates): Use add_standard_iv_candidates_for_size.
+
+2004-04-04 Richard Sandiford <rsandifo@redhat.com>
+
* system.h (GCOV_SIZE_TYPE): Unposion.
* gcov-io.h (GCOV_TYPE_NODE): Delete, replacing with...
(GCOV_TYPE_SIZE): ...this new macro.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 6719bb0..b73170a 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1746,7 +1746,7 @@ tree-ssa-loop-ivopts.o : tree-ssa-loop-ivopts.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) varray.h $(EXPR_H) \
output.h diagnostic.h $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
tree-pass.h $(GGC_H) $(RECOG_H) insn-config.h $(HASHTAB_H) $(SCEV_H) \
- cfgloop.h $(PARAMS_H) sbitmap.h
+ cfgloop.h $(PARAMS_H) sbitmap.h langhooks.h
tree-ssa-loop-manip.o : tree-ssa-loop-manip.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) \
output.h diagnostic.h $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 7853d69..494b41e 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -88,6 +88,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tree-scalar-evolution.h"
#include "cfgloop.h"
#include "params.h"
+#include "langhooks.h"
/* The infinite cost. */
#define INFTY 10000000
@@ -1980,23 +1981,28 @@ add_candidate (struct ivopts_data *data,
add_candidate_1 (data, base, step, important, IP_END, use, NULL_TREE);
}
+/* Add a standard "0 + 1 * iteration" iv candidate for a
+ type with SIZE bits. */
+
+static void
+add_standard_iv_candidates_for_size (struct ivopts_data *data,
+ unsigned int size)
+{
+ tree type = lang_hooks.types.type_for_size (size, true);
+ add_candidate (data, build_int_cst (type, 0), build_int_cst (type, 1),
+ true, NULL);
+}
+
/* Adds standard iv candidates. */
static void
add_standard_iv_candidates (struct ivopts_data *data)
{
- /* Add 0 + 1 * iteration candidate. */
- add_candidate (data,
- build_int_cst (unsigned_intSI_type_node, 0),
- build_int_cst (unsigned_intSI_type_node, 1),
- true, NULL);
+ add_standard_iv_candidates_for_size (data, INT_TYPE_SIZE);
- /* The same for a long type if it is still fast enough. */
- if (BITS_PER_WORD > 32)
- add_candidate (data,
- build_int_cst (unsigned_intDI_type_node, 0),
- build_int_cst (unsigned_intDI_type_node, 1),
- true, NULL);
+ /* The same for a double-integer type if it is still fast enough. */
+ if (BITS_PER_WORD >= INT_TYPE_SIZE * 2)
+ add_standard_iv_candidates_for_size (data, INT_TYPE_SIZE * 2);
}