aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2012-10-30 14:14:04 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-10-30 14:14:04 +0000
commitc12d9242290c13be552bd6fa6c0524ef9aa650e6 (patch)
tree27eee1b7d0801cca31979014c870c66a30fe182c /gcc/tree-inline.c
parent2e2e628b24501fc8362ec1797c331091e702f5a5 (diff)
downloadgcc-c12d9242290c13be552bd6fa6c0524ef9aa650e6.zip
gcc-c12d9242290c13be552bd6fa6c0524ef9aa650e6.tar.gz
gcc-c12d9242290c13be552bd6fa6c0524ef9aa650e6.tar.bz2
gimple.h (gimple_store_p): New predicate.
2012-10-30 Richard Biener <rguenther@suse.de> * gimple.h (gimple_store_p): New predicate. (gimple_assign_load_p): Likewise. * tree-inline.c (estimate_num_insns): Use it. * gcc.dg/vect/slp-perm-2.c: Adjust. From-SVN: r192987
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 2c8071e..69a664d 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -3512,12 +3512,12 @@ estimate_num_insns (gimple stmt, eni_weights *weights)
lhs = gimple_assign_lhs (stmt);
rhs = gimple_assign_rhs1 (stmt);
- if (is_gimple_reg (lhs))
- cost = 0;
- else
- cost = estimate_move_cost (TREE_TYPE (lhs));
+ cost = 0;
- if (!is_gimple_reg (rhs) && !is_gimple_min_invariant (rhs))
+ /* Account for the cost of moving to / from memory. */
+ if (gimple_store_p (stmt))
+ cost += estimate_move_cost (TREE_TYPE (lhs));
+ if (gimple_assign_load_p (stmt))
cost += estimate_move_cost (TREE_TYPE (rhs));
cost += estimate_operator_cost (gimple_assign_rhs_code (stmt), weights,