+ remat_cost = check_remat_conditions_costs(env, to_spill,
+ reloader, 0);
+ if(remat_cost >= REMAT_COST_INFINITE) {
+ DBG((dbg, LEVEL_2, "\tremat before %+F not possible\n",
+ reloader));
+ rld->remat_cost_delta = REMAT_COST_INFINITE;
+ all_remat_costs = REMAT_COST_INFINITE;
+ continue;
+ }
+
+ remat_cost_delta = remat_cost - env->reload_cost;
+ rld->remat_cost_delta = remat_cost_delta;
+ block = is_Block(reloader) ? reloader : get_nodes_block(reloader);
+ freq = get_block_execfreq(exec_freq, block);
+ all_remat_costs += remat_cost_delta * freq;
+ DBG((dbg, LEVEL_2, "\tremat costs delta before %+F: "
+ "%d (rel %f)\n", reloader, remat_cost_delta,
+ remat_cost_delta * freq));
+ }
+ if(all_remat_costs < REMAT_COST_INFINITE) {
+ ir_node *block = get_nodes_block(to_spill);
+ double freq = get_block_execfreq(exec_freq, block);
+ /* we don't need the costs for the spill if we can remat
+ all reloaders */
+ all_remat_costs -= env->spill_cost * freq;
+
+ DBG((dbg, LEVEL_2, "\tspill costs %d (rel %f)\n",
+ env->spill_cost, env->spill_cost * freq));
+ }
+
+ if(all_remat_costs < 0) {
+ DBG((dbg, LEVEL_1, "\nforcing remats of all reloaders (%f)\n",
+ all_remat_costs));
+ force_remat = 1;
+ }
+ }