OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* config.gcc (powerpc-*-linux*): Merge variants.
[pf3gnuchains/gcc-fork.git]
/
gcc
/
tree-ssa-loop-ivopts.c
diff --git
a/gcc/tree-ssa-loop-ivopts.c
b/gcc/tree-ssa-loop-ivopts.c
index
a1f5c47
..
fcaf784
100644
(file)
--- a/
gcc/tree-ssa-loop-ivopts.c
+++ b/
gcc/tree-ssa-loop-ivopts.c
@@
-1,6
+1,6
@@
/* Induction variable optimizations.
/* Induction variable optimizations.
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
Free Software
- Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
, 2009
+ F
ree Software F
oundation, Inc.
This file is part of GCC.
This file is part of GCC.
@@
-219,15
+219,12
@@
struct ivopts_data
/* The currently optimized loop. */
struct loop *current_loop;
/* The currently optimized loop. */
struct loop *current_loop;
- /*
Are we optimizing for speed?
*/
-
bool speed
;
+ /*
Numbers of iterations for all exits of the current loop.
*/
+
struct pointer_map_t *niters
;
/* Number of registers used in it. */
unsigned regs_used;
/* Number of registers used in it. */
unsigned regs_used;
- /* Numbers of iterations for all exits of the current loop. */
- struct pointer_map_t *niters;
-
/* The size of version_info array allocated. */
unsigned version_info_size;
/* The size of version_info array allocated. */
unsigned version_info_size;
@@
-237,9
+234,6
@@
struct ivopts_data
/* The bitmap of indices in version_info whose value was changed. */
bitmap relevant;
/* The bitmap of indices in version_info whose value was changed. */
bitmap relevant;
- /* The maximum invariant id. */
- unsigned max_inv_id;
-
/* The uses of induction variables. */
VEC(iv_use_p,heap) *iv_uses;
/* The uses of induction variables. */
VEC(iv_use_p,heap) *iv_uses;
@@
-249,9
+243,15
@@
struct ivopts_data
/* A bitmap of important candidates. */
bitmap important_candidates;
/* A bitmap of important candidates. */
bitmap important_candidates;
+ /* The maximum invariant id. */
+ unsigned max_inv_id;
+
/* Whether to consider just related and important candidates when replacing a
use. */
bool consider_all_candidates;
/* Whether to consider just related and important candidates when replacing a
use. */
bool consider_all_candidates;
+
+ /* Are we optimizing for speed? */
+ bool speed;
};
/* An assignment of iv candidates to uses. */
};
/* An assignment of iv candidates to uses. */
@@
-884,7
+884,7
@@
determine_biv_step (gimple phi)
if (!is_gimple_reg (name))
return NULL_TREE;
if (!is_gimple_reg (name))
return NULL_TREE;
- if (!simple_iv (loop,
phi
, name, &iv, true))
+ if (!simple_iv (loop,
loop
, name, &iv, true))
return NULL_TREE;
return integer_zerop (iv.step) ? NULL_TREE : iv.step;
return NULL_TREE;
return integer_zerop (iv.step) ? NULL_TREE : iv.step;
@@
-990,7
+990,7
@@
find_givs_in_stmt_scev (struct ivopts_data *data, gimple stmt, affine_iv *iv)
if (TREE_CODE (lhs) != SSA_NAME)
return false;
if (TREE_CODE (lhs) != SSA_NAME)
return false;
- if (!simple_iv (loop,
stmt
, lhs, iv, true))
+ if (!simple_iv (loop,
loop_containing_stmt (stmt)
, lhs, iv, true))
return false;
iv->base = expand_simple_operations (iv->base);
return false;
iv->base = expand_simple_operations (iv->base);
@@
-1562,14
+1562,15
@@
may_be_nonaddressable_p (tree expr)
and make them look addressable. After some processing the
non-addressability may be uncovered again, causing ADDR_EXPRs
of inappropriate objects to be built. */
and make them look addressable. After some processing the
non-addressability may be uncovered again, causing ADDR_EXPRs
of inappropriate objects to be built. */
- return is_gimple_reg (TREE_OPERAND (expr, 0))
- || !is_gimple_addressable (TREE_OPERAND (expr, 0))
- || may_be_nonaddressable_p (TREE_OPERAND (expr, 0));
+ if (is_gimple_reg (TREE_OPERAND (expr, 0))
+ || !is_gimple_addressable (TREE_OPERAND (expr, 0)))
+ return true;
+
+ /* ... fall through ... */
case ARRAY_REF:
case ARRAY_RANGE_REF:
case ARRAY_REF:
case ARRAY_RANGE_REF:
- return TYPE_NONALIASED_COMPONENT (TREE_TYPE (TREE_OPERAND (expr, 0)))
- || may_be_nonaddressable_p (TREE_OPERAND (expr, 0));
+ return may_be_nonaddressable_p (TREE_OPERAND (expr, 0));
CASE_CONVERT:
return true;
CASE_CONVERT:
return true;
@@
-2070,9
+2071,7
@@
add_candidate_1 (struct ivopts_data *data,
{
orig_type = TREE_TYPE (base);
type = generic_type_for (orig_type);
{
orig_type = TREE_TYPE (base);
type = generic_type_for (orig_type);
- /* Don't convert the base to the generic type for pointers as the generic
- type is an integer type with the same size as the pointer type. */
- if (type != orig_type && !POINTER_TYPE_P (orig_type))
+ if (type != orig_type)
{
base = fold_convert (type, base);
step = fold_convert (type, step);
{
base = fold_convert (type, base);
step = fold_convert (type, step);