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
* ira-color.c (allocno_reload_assign): Avoid accumulating
[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
74dadf7
..
9592832
100644
(file)
--- a/
gcc/tree-ssa-loop-ivopts.c
+++ b/
gcc/tree-ssa-loop-ivopts.c
@@
-1,5
+1,5
@@
/* Induction variable optimizations.
/* Induction variable optimizations.
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
, 2010
Free Software Foundation, Inc.
This file is part of GCC.
Free Software Foundation, Inc.
This file is part of GCC.
@@
-67,17
+67,16
@@
along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
-#include "rtl.h"
#include "tm_p.h"
#include "tm_p.h"
-#include "hard-reg-set.h"
#include "basic-block.h"
#include "output.h"
#include "diagnostic.h"
#include "basic-block.h"
#include "output.h"
#include "diagnostic.h"
+#include "tree-pretty-print.h"
+#include "gimple-pretty-print.h"
#include "tree-flow.h"
#include "tree-dump.h"
#include "timevar.h"
#include "cfgloop.h"
#include "tree-flow.h"
#include "tree-dump.h"
#include "timevar.h"
#include "cfgloop.h"
-#include "varray.h"
#include "expr.h"
#include "tree-pass.h"
#include "ggc.h"
#include "expr.h"
#include "tree-pass.h"
#include "ggc.h"
@@
-120,8
+119,8
@@
struct version_info
struct iv *iv; /* Induction variable description. */
bool has_nonlin_use; /* For a loop-level invariant, whether it is used in
an expression that is not an induction variable. */
struct iv *iv; /* Induction variable description. */
bool has_nonlin_use; /* For a loop-level invariant, whether it is used in
an expression that is not an induction variable. */
- unsigned inv_id; /* Id of an invariant. */
bool preserve_biv; /* For the original biv, whether to preserve it. */
bool preserve_biv; /* For the original biv, whether to preserve it. */
+ unsigned inv_id; /* Id of an invariant. */
};
/* Types of uses. */
};
/* Types of uses. */
@@
-192,7
+191,7
@@
struct iv_cand
unsigned id; /* The number of the candidate. */
bool important; /* Whether this is an "important" candidate, i.e. such
that it should be considered by all uses. */
unsigned id; /* The number of the candidate. */
bool important; /* Whether this is an "important" candidate, i.e. such
that it should be considered by all uses. */
-
enum iv_position pos;
/* Where it is computed. */
+
ENUM_BITFIELD(iv_position) pos : 8;
/* Where it is computed. */
gimple incremented_at;/* For original biv, the statement where it is
incremented. */
tree var_before; /* The variable used for it before increment. */
gimple incremented_at;/* For original biv, the statement where it is
incremented. */
tree var_before; /* The variable used for it before increment. */
@@
-1537,16
+1536,18
@@
may_be_unaligned_p (tree ref, tree step)
if (mode != BLKmode)
{
if (mode != BLKmode)
{
- double_int mul;
- tree al = build_int_cst (TREE_TYPE (step),
- GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT);
+ unsigned mode_align = GET_MODE_ALIGNMENT (mode);
+
+ if (base_align < mode_align
+ || (bitpos % mode_align) != 0
+ || (bitpos % BITS_PER_UNIT) != 0)
+ return true;
- if (base_align < GET_MODE_ALIGNMENT (mode)
- || bitpos % GET_MODE_ALIGNMENT (mode) != 0
- || bitpos % BITS_PER_UNIT != 0)
+ if (toffset
+ && (highest_pow2_factor (toffset) * BITS_PER_UNIT) < mode_align)
return true;
return true;
- if (
!constant_multiple_of (step, al, &mul)
)
+ if (
(highest_pow2_factor (step) * BITS_PER_UNIT) < mode_align
)
return true;
}
return true;
}
@@
-2738,9
+2739,10
@@
computation_cost (tree expr, bool speed)
unsigned cost;
/* Avoid using hard regs in ways which may be unsupported. */
int regno = LAST_VIRTUAL_REGISTER + 1;
unsigned cost;
/* Avoid using hard regs in ways which may be unsupported. */
int regno = LAST_VIRTUAL_REGISTER + 1;
- enum function_frequency real_frequency = cfun->function_frequency;
+ struct cgraph_node *node = cgraph_node (current_function_decl);
+ enum node_frequency real_frequency = node->frequency;
-
cfun->function_frequency = FUNCTION
_FREQUENCY_NORMAL;
+
node->frequency = NODE
_FREQUENCY_NORMAL;
crtl->maybe_hot_insn_p = speed;
walk_tree (&expr, prepare_decl_rtl, ®no, NULL);
start_sequence ();
crtl->maybe_hot_insn_p = speed;
walk_tree (&expr, prepare_decl_rtl, ®no, NULL);
start_sequence ();
@@
-2748,7
+2750,7
@@
computation_cost (tree expr, bool speed)
seq = get_insns ();
end_sequence ();
default_rtl_profile ();
seq = get_insns ();
end_sequence ();
default_rtl_profile ();
-
cfun->function_
frequency = real_frequency;
+
node->
frequency = real_frequency;
cost = seq_cost (seq, speed);
if (MEM_P (rslt))
cost = seq_cost (seq, speed);
if (MEM_P (rslt))
@@
-4121,7
+4123,8
@@
determine_use_iv_cost_condition (struct ivopts_data *data,
TODO: The constant that we're substracting from the cost should
be target-dependent. This information should be added to the
target costs for each backend. */
TODO: The constant that we're substracting from the cost should
be target-dependent. This information should be added to the
target costs for each backend. */
- if (integer_zerop (*bound_cst)
+ if (!infinite_cost_p (elim_cost) /* Do not try to decrease infinite! */
+ && integer_zerop (*bound_cst)
&& (operand_equal_p (*control_var, cand->var_after, 0)
|| operand_equal_p (*control_var, cand->var_before, 0)))
elim_cost.cost -= 1;
&& (operand_equal_p (*control_var, cand->var_after, 0)
|| operand_equal_p (*control_var, cand->var_before, 0)))
elim_cost.cost -= 1;
@@
-5516,7
+5519,11
@@
copy_ref_info (tree new_ref, tree old_ref)
if (TREE_CODE (old_ref) == TARGET_MEM_REF)
copy_mem_ref_info (new_ref, old_ref);
else
if (TREE_CODE (old_ref) == TARGET_MEM_REF)
copy_mem_ref_info (new_ref, old_ref);
else
- TMR_ORIGINAL (new_ref) = unshare_and_remove_ssa_names (old_ref);
+ {
+ TMR_ORIGINAL (new_ref) = unshare_and_remove_ssa_names (old_ref);
+ TREE_SIDE_EFFECTS (new_ref) = TREE_SIDE_EFFECTS (old_ref);
+ TREE_THIS_VOLATILE (new_ref) = TREE_THIS_VOLATILE (old_ref);
+ }
}
/* Rewrites USE (address that is an iv) using candidate CAND. */
}
/* Rewrites USE (address that is an iv) using candidate CAND. */