diff options
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 2c8071e8c99..69a664dbfcc 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, |