Commit 589eed20 authored by Matthias Braun's avatar Matthias Braun
Browse files

bespillutil: cleanup, use C99

parent 380a9059
......@@ -310,7 +310,7 @@ static void displace(workset_t *const new_vals, bool const is_usage,
DB((dbg, DBG_DECIDE, " insert %+F\n", val));
if (is_usage) {
DB((dbg, DBG_SPILL, "Reload %+F before %+F\n", val, instr));
be_add_reload(senv, val, instr, cls, 1);
be_add_reload(senv, val, instr);
reloaded = true;
} else {
......@@ -827,7 +827,7 @@ static void fix_block_borders(ir_node *block, void *data)
/* node is not in register at the end of pred -> reload it */
DB((dbg, DBG_FIX, " reload %+F\n", node));
DB((dbg, DBG_SPILL, "Reload %+F before %+F,%d\n", node, block, i));
be_add_reload_on_edge(senv, node, block, i, cls, 1);
be_add_reload_on_edge(senv, node, block, i);
......@@ -108,9 +108,9 @@ static void spill_node(ir_node *node)
int in = get_edge_src_pos(edge);
ir_node *block = get_nodes_block(use);
be_add_reload_on_edge(spill_env, node, block, in, cls, 1);
be_add_reload_on_edge(spill_env, node, block, in);
} else {
be_add_reload(spill_env, node, use, cls, 1);
be_add_reload(spill_env, node, use);
This diff is collapsed.
......@@ -13,6 +13,7 @@
#include <stdbool.h>
#include "firm_types.h"
#include "debug.h"
......@@ -50,20 +51,15 @@ void be_add_spill(spill_env_t *senv, ir_node *to_spill, ir_node *after);
* @param senv The spill environment
* @param to_spill The node which is about to be spilled
* @param before The node before the reload should be added
* @param reload_cls The register class the reloaded value will be put into
* @param allow_remat Set to 1 if the node may be rematerialized instead of
* reloaded
void be_add_reload(spill_env_t *senv, ir_node *to_spill, ir_node *before,
const arch_register_class_t *reload_cls, int allow_remat);
void be_add_reload(spill_env_t *senv, ir_node *to_spill, ir_node *before);
* Analog to be_add_reload, but places the reload "on an edge" between 2 blocks
* @see be_add_reload
void be_add_reload_on_edge(spill_env_t *senv, ir_node *to_spill, ir_node *bl,
int pos, const arch_register_class_t *reload_cls,
int allow_remat);
int pos);
* The main function that places real spills/reloads (or rematerializes values)
......@@ -112,8 +108,8 @@ double be_get_reload_costs_on_edge(spill_env_t *env, ir_node *to_spill,
typedef struct {
unsigned n_spills;
unsigned n_reloads;
double spill_costs;
double reload_costs;
double spill_costs;
double reload_costs;
} be_total_spill_costs_t;
......@@ -135,9 +131,9 @@ void be_get_total_spill_costs(ir_graph *irg, be_total_spill_costs_t *costs);
* Check, if a node is rematerializable.
* @param env The spill env.
int be_is_rematerializable(spill_env_t *env, const ir_node *to_remat, const ir_node *before);
bool be_is_rematerializable(spill_env_t *env, const ir_node *to_remat,
const ir_node *before);
* Create a be_Spill node. This function is compatible to the
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment