Lines Matching refs:cost

40    3) The optimal (w.r. to a cost function) set of variables is chosen.  The
41 cost function assigns a cost to sets of induction variables and consists
45 variable in the set and adds its cost to the sum. The cost reflects
48 -- The variable costs. Each of the variables has a cost assigned that
51 -- The set cost. Depending on the size of the set, extra cost may be
93 /* The infinite cost. */
132 /* The candidate - cost pair. */
136 unsigned cost; /* The cost. */
186 unsigned cost; /* Cost of the candidate. */
263 /* Total cost of expressing uses. */
266 /* Total cost of candidates. */
272 /* Total cost of the assignment. */
273 unsigned cost;
2331 /* Sets cost of (USE, CANDIDATE) pair to COST and record that it depends
2337 struct iv_use *use, struct iv_cand *cand, unsigned cost,
2342 if (cost == INFTY)
2351 use->cost_map[cand->id].cost = cost;
2370 use->cost_map[i].cost = cost;
2375 /* Gets cost of (USE, CANDIDATE) pair. */
2409 /* Returns estimate on cost of computing SEQ. */
2414 unsigned cost = 0;
2421 cost += rtx_cost (set, SET);
2423 cost++;
2426 return cost;
2505 /* Determines cost of the computation of EXPR. */
2512 unsigned cost;
2522 cost = seq_cost (seq);
2524 cost += address_cost (XEXP (rslt, 0), TYPE_MODE (type));
2526 return cost;
3219 /* Returns cost of addition in MODE. */
3226 unsigned cost;
3239 cost = seq_cost (seq);
3240 if (!cost)
3241 cost = 1;
3243 costs[mode] = cost;
3247 GET_MODE_NAME (mode), cost);
3248 return cost;
3256 unsigned cost; /* The cost. */
3281 /* Returns cost of multiplication by constant CST in MODE. */
3289 unsigned cost;
3298 return (*cached)->cost;
3310 cost = seq_cost (seq);
3314 (int) cst, GET_MODE_NAME (mode), cost);
3316 (*cached)->cost = cost;
3318 return cost;
3362 /* Returns cost of address in shape symbol + var + OFFSET + RATIO * index.
3376 unsigned cost, acost;
3427 /* Compute the cost of various addressing modes. */
3491 SYMBOL_PRESENT = false is cheaper even with cost of addition, and
3543 cost = 0;
3550 cost += multiply_by_cost (ratio, Pmode);
3554 cost += add_cost (Pmode);
3559 return cost + acost;
3562 /* Estimates cost of forcing expression EXPR into a variable. */
3572 unsigned cost0, cost1, cost;
3663 cost = add_cost (mode);
3668 cost = multiply_by_cost (int_cst_value (op0), mode);
3670 cost = multiply_by_cost (int_cst_value (op1), mode);
3679 cost += cost0;
3680 cost += cost1;
3682 /* Bound the cost by target_spill_cost. The parts of complicated
3686 return cost < target_spill_cost ? cost : target_spill_cost;
3689 /* Estimates cost of forcing EXPR into a variable. DEPENDS_ON is a set of the
3705 /* Estimates cost of expressing address ADDR as var + symbol + offset. The
3750 /* Estimates cost of expressing difference of addresses E1 - E2 as
3762 unsigned cost;
3781 cost = force_var_cost (data, e1, depends_on);
3782 cost += force_var_cost (data, e2, depends_on);
3783 cost += add_cost (Pmode);
3785 return cost;
3788 /* Estimates cost of expressing difference E1 - E2 as
3799 unsigned cost;
3826 cost = force_var_cost (data, e2, depends_on);
3827 cost += multiply_by_cost (-1, mode);
3829 return cost;
3832 cost = force_var_cost (data, e1, depends_on);
3833 cost += force_var_cost (data, e2, depends_on);
3834 cost += add_cost (mode);
3836 return cost;
3839 /* Determines the cost of the computation by that USE is expressed
3856 unsigned cost = 0, n_sums;
3935 cost += difference_cost (data,
3942 cost += difference_cost (data,
3949 cost += force_var_cost (data, cbase, depends_on);
3950 cost += add_cost (TYPE_MODE (ctype));
3951 cost += difference_cost (data,
3964 find the cost of addressing this. */
3966 return cost + get_address_cost (symbol_present, var_present, offset, ratio);
3973 cost += multiply_by_cost (ratio, TYPE_MODE (ctype));
3975 return cost;
3979 cost += multiply_by_cost (aratio, TYPE_MODE (ctype));
3987 return cost + n_sums * add_cost (TYPE_MODE (ctype));
3991 /* Just get the expression, expand it and measure the cost. */
4004 /* Determines the cost of the computation by that USE is expressed
4019 /* Determines cost of basing replacement of USE on CAND in a generic
4027 unsigned cost;
4030 original biv, the cost is 0. This also prevents us from counting the
4031 cost of increment twice -- once at this use and once in the cost of
4040 cost = get_computation_cost (data, use, cand, false, &depends_on);
4041 set_use_iv_cost (data, use, cand, cost, depends_on, NULL_TREE);
4043 return cost != INFTY;
4046 /* Determines cost of basing replacement of USE on CAND in an address. */
4053 unsigned cost = get_computation_cost (data, use, cand, true, &depends_on);
4055 set_use_iv_cost (data, use, cand, cost, depends_on, NULL_TREE);
4057 return cost != INFTY;
4188 /* Determines cost of basing replacement of USE on CAND in a condition. */
4196 unsigned cost;
4207 cost = force_var_cost (data, bound, &depends_on);
4209 set_use_iv_cost (data, use, cand, cost, depends_on, bound);
4210 return cost != INFTY;
4216 cost = get_computation_cost (data, use, cand, false, &depends_on);
4232 set_use_iv_cost (data, use, cand, cost, depends_on, NULL);
4233 return cost != INFTY;
4236 /* Determines cost of basing replacement of USE on CAND. Returns false
4294 /* Remove the candidates for that the cost is infinite from
4316 || use->cost_map[j].cost == INFTY)
4321 use->cost_map[j].cost);
4334 /* Determines cost of the candidate CAND. */
4344 cand->cost = 0;
4356 cand->cost = cost_step + cost_base / AVG_LOOP_NITER (current_loop);
4363 cand->cost--;
4369 cand->cost++;
4392 fprintf (dump_file, " %d\t%d\n", i, cand->cost);
4399 /* Calculates cost for having SIZE induction variables. */
4418 cost function -- TODO):
4431 -- if U + I + R <= A, the cost is I * SMALL_COST (just not to encourage
4433 -- if A - R < U + I <= A, the cost is I * PRES_COST
4434 -- if U + I > A, the cost is I * PRES_COST and
4474 fprintf (dump_file, " cost for size:\n");
4483 /* Returns true if A is a cheaper cost pair than B. */
4494 if (a->cost < b->cost)
4497 if (a->cost > b->cost)
4501 if (a->cand->cost < b->cand->cost)
4507 /* Computes the cost field of IVS structure. */
4512 unsigned cost = 0;
4514 cost += ivs->cand_use_cost;
4515 cost += ivs->cand_cost;
4516 cost += ivopts_global_cost_for_size (data, ivs->n_regs);
4518 ivs->cost = cost;
4565 ivs->cand_cost -= cp->cand->cost;
4570 ivs->cand_use_cost -= cp->cost;
4595 /* Set cost pair for USE in set IVS to CP. */
4623 ivs->cand_cost += cp->cand->cost;
4628 ivs->cand_use_cost += cp->cost;
4664 /* Get cost for assignment IVS. */
4669 return (ivs->bad_uses ? INFTY : ivs->cost);
4834 nw->cost = 0;
4860 fprintf (file, " cost %d\n", iv_ca_cost (ivs));
4872 /* Try changing candidate in IVS to CAND for each use. Return cost of the
4881 unsigned i, cost;
4909 cost = iv_ca_cost (ivs);
4914 return cost;
4917 /* Try narrowing set IVS by removing CAND. Return the cost of
4929 unsigned cost;
4995 cost = iv_ca_cost (ivs);
4998 return cost;
5002 from to EXCEPT_CAND from it. Return cost of the new set, and store
5228 solution and remove the unused ivs while this improves the cost. */
5262 fprintf (dump_file, "Final cost %d\n\n", iv_ca_cost (set));