Commit a767106e authored by Moritz Kroll's avatar Moritz Kroll
Browse files

Added cons_flags parameter to new_Load and new_Store functions for volatility,...

Added cons_flags parameter to new_Load and new_Store functions for volatility, alignment and pin state

[r24655]
parent 226176ca
...@@ -295,8 +295,8 @@ ...@@ -295,8 +295,8 @@
* ir_node *new_Cast (ir_node *op, ir_type *to_tp); * ir_node *new_Cast (ir_node *op, ir_type *to_tp);
* ir_node *new_Carry (ir_node *op1, ir_node *op2, ir_mode *mode); * ir_node *new_Carry (ir_node *op1, ir_node *op2, ir_mode *mode);
* ir_node *new_Borrow (ir_node *op1, ir_node *op2, ir_mode *mode); * ir_node *new_Borrow (ir_node *op1, ir_node *op2, ir_mode *mode);
* ir_node *new_Load (ir_node *store, ir_node *addr, ir_mode *mode); * ir_node *new_Load (ir_node *store, ir_node *addr, ir_mode *mode, cons_flags flags);
* ir_node *new_Store (ir_node *store, ir_node *addr, ir_node *val); * ir_node *new_Store (ir_node *store, ir_node *addr, ir_node *val, cons_flags flags);
* ir_node *new_Alloc (ir_node *store, ir_node *size, ir_type *alloc_type, * ir_node *new_Alloc (ir_node *store, ir_node *size, ir_type *alloc_type,
* where_alloc where); * where_alloc where);
* ir_node *new_Free (ir_node *store, ir_node *ptr, ir_node *size, * ir_node *new_Free (ir_node *store, ir_node *ptr, ir_node *size,
...@@ -853,7 +853,7 @@ ...@@ -853,7 +853,7 @@
* OPERATIONS TO MANAGE MEMORY EXPLICITLY * OPERATIONS TO MANAGE MEMORY EXPLICITLY
* -------------------------------------- * --------------------------------------
* *
* ir_node *new_Load (ir_node *store, ir_node *addr, ir_mode *mode) * ir_node *new_Load (ir_node *store, ir_node *addr, ir_mode *mode, cons_flags flags)
* ---------------------------------------------------------------- * ----------------------------------------------------------------
* *
* The Load operation reads a value from memory. * The Load operation reads a value from memory.
...@@ -862,6 +862,7 @@ ...@@ -862,6 +862,7 @@
* *store The current memory. * *store The current memory.
* *addr A pointer to the variable to be read in this memory. * *addr A pointer to the variable to be read in this memory.
* *mode The mode of the value to be loaded. * *mode The mode of the value to be loaded.
* flags Additional flags for alignment, volatility and pin state.
* *
* Inputs: * Inputs:
* The memory and a pointer to a variable in this memory. * The memory and a pointer to a variable in this memory.
...@@ -869,7 +870,7 @@ ...@@ -869,7 +870,7 @@
* A tuple of the memory, a control flow to be taken in case of * A tuple of the memory, a control flow to be taken in case of
* an exception and the loaded value. * an exception and the loaded value.
* *
* ir_node *new_Store (ir_node *store, ir_node *addr, ir_node *val) * ir_node *new_Store (ir_node *store, ir_node *addr, ir_node *val, cons_flags flags)
* ---------------------------------------------------------------- * ----------------------------------------------------------------
* *
* The Store operation writes a value to a variable in memory. * The Store operation writes a value to a variable in memory.
...@@ -1121,6 +1122,13 @@ ...@@ -1121,6 +1122,13 @@
#include "firm_types.h" #include "firm_types.h"
typedef enum cons_flags {
cons_none = 0,
cons_volatile = 1U << 0,
cons_unaligned = 1U << 1,
cons_floats = 1U << 2
} cons_flags;
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/* The raw interface */ /* The raw interface */
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -1740,9 +1748,10 @@ ir_node *new_rd_Phi (dbg_info *db, ir_graph *irg, ir_node *block, int arity, ...@@ -1740,9 +1748,10 @@ ir_node *new_rd_Phi (dbg_info *db, ir_graph *irg, ir_node *block, int arity,
* @param *store The current memory * @param *store The current memory
* @param *adr A pointer to the variable to be read in this memory. * @param *adr A pointer to the variable to be read in this memory.
* @param *mode The mode of the value to be loaded. * @param *mode The mode of the value to be loaded.
* @param flags Additional flags for alignment, volatility and pin state.
*/ */
ir_node *new_rd_Load (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *new_rd_Load (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *store, ir_node *adr, ir_mode *mode); ir_node *store, ir_node *adr, ir_mode *mode, cons_flags flags);
/** Constructor for a Store node. /** Constructor for a Store node.
* *
...@@ -1752,9 +1761,10 @@ ir_node *new_rd_Load (dbg_info *db, ir_graph *irg, ir_node *block, ...@@ -1752,9 +1761,10 @@ ir_node *new_rd_Load (dbg_info *db, ir_graph *irg, ir_node *block,
* @param *store The current memory * @param *store The current memory
* @param *adr A pointer to the variable to be read in this memory. * @param *adr A pointer to the variable to be read in this memory.
* @param *val The value to write to this variable. * @param *val The value to write to this variable.
* @param flags Additional flags for alignment, volatility and pin state.
*/ */
ir_node *new_rd_Store (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *new_rd_Store (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *store, ir_node *adr, ir_node *val); ir_node *store, ir_node *adr, ir_node *val, cons_flags flags);
/** Constructor for a Alloc node. /** Constructor for a Alloc node.
* *
...@@ -2542,9 +2552,10 @@ ir_node *new_r_Phi (ir_graph *irg, ir_node *block, int arity, ...@@ -2542,9 +2552,10 @@ ir_node *new_r_Phi (ir_graph *irg, ir_node *block, int arity,
* @param *store The current memory * @param *store The current memory
* @param *adr A pointer to the variable to be read in this memory. * @param *adr A pointer to the variable to be read in this memory.
* @param *mode The mode of the value to be loaded. * @param *mode The mode of the value to be loaded.
* @param flags Additional flags for alignment, volatility and pin state.
*/ */
ir_node *new_r_Load (ir_graph *irg, ir_node *block, ir_node *new_r_Load (ir_graph *irg, ir_node *block,
ir_node *store, ir_node *adr, ir_mode *mode); ir_node *store, ir_node *adr, ir_mode *mode, cons_flags flags);
/** Constructor for a Store node. /** Constructor for a Store node.
* *
...@@ -2553,9 +2564,10 @@ ir_node *new_r_Load (ir_graph *irg, ir_node *block, ...@@ -2553,9 +2564,10 @@ ir_node *new_r_Load (ir_graph *irg, ir_node *block,
* @param *store The current memory * @param *store The current memory
* @param *adr A pointer to the variable to be read in this memory. * @param *adr A pointer to the variable to be read in this memory.
* @param *val The value to write to this variable. * @param *val The value to write to this variable.
* @param flags Additional flags for alignment, volatility and pin state.
*/ */
ir_node *new_r_Store (ir_graph *irg, ir_node *block, ir_node *new_r_Store (ir_graph *irg, ir_node *block,
ir_node *store, ir_node *adr, ir_node *val); ir_node *store, ir_node *adr, ir_node *val, cons_flags flags);
/** Constructor for a Alloc node. /** Constructor for a Alloc node.
* *
...@@ -3369,8 +3381,9 @@ ir_node *new_d_Phi (dbg_info *db, int arity, ir_node *in[], ir_mode *mode); ...@@ -3369,8 +3381,9 @@ ir_node *new_d_Phi (dbg_info *db, int arity, ir_node *in[], ir_mode *mode);
* @param *store The current memory * @param *store The current memory
* @param *addr A pointer to the variable to be read in this memory. * @param *addr A pointer to the variable to be read in this memory.
* @param *mode The mode of the value to be loaded. * @param *mode The mode of the value to be loaded.
* @param flags Additional flags for alignment, volatility and pin state.
*/ */
ir_node *new_d_Load (dbg_info *db, ir_node *store, ir_node *addr, ir_mode *mode); ir_node *new_d_Load(dbg_info *db, ir_node *store, ir_node *addr, ir_mode *mode, cons_flags flags);
/** Constructor for a Store node. /** Constructor for a Store node.
* *
...@@ -3380,8 +3393,9 @@ ir_node *new_d_Load (dbg_info *db, ir_node *store, ir_node *addr, ir_mode *mod ...@@ -3380,8 +3393,9 @@ ir_node *new_d_Load (dbg_info *db, ir_node *store, ir_node *addr, ir_mode *mod
* @param *store The current memory * @param *store The current memory
* @param *addr A pointer to the variable to be read in this memory. * @param *addr A pointer to the variable to be read in this memory.
* @param *val The value to write to this variable. * @param *val The value to write to this variable.
* @param flags Additional flags for alignment, volatility and pin state.
*/ */
ir_node *new_d_Store (dbg_info *db, ir_node *store, ir_node *addr, ir_node *val); ir_node *new_d_Store(dbg_info *db, ir_node *store, ir_node *addr, ir_node *val, cons_flags flags);
/** Constructor for a Alloc node. /** Constructor for a Alloc node.
* *
...@@ -4154,16 +4168,18 @@ ir_node *new_Phi (int arity, ir_node *in[], ir_mode *mode); ...@@ -4154,16 +4168,18 @@ ir_node *new_Phi (int arity, ir_node *in[], ir_mode *mode);
* @param *store The current memory. * @param *store The current memory.
* @param *addr A pointer to the variable to be read in this memory. * @param *addr A pointer to the variable to be read in this memory.
* @param *mode The mode of the value to be loaded. * @param *mode The mode of the value to be loaded.
* @param flags Additional flags for alignment, volatility and pin state.
*/ */
ir_node *new_Load (ir_node *store, ir_node *addr, ir_mode *mode); ir_node *new_Load(ir_node *store, ir_node *addr, ir_mode *mode, cons_flags flags);
/** Constructor for a Store node. /** Constructor for a Store node.
* *
* @param *store The current memory. * @param *store The current memory.
* @param *addr A pointer to the variable to be read in this memory. * @param *addr A pointer to the variable to be read in this memory.
* @param *val The value to write to this variable. * @param *val The value to write to this variable.
* @param flags Additional flags for alignment, volatility and pin state.
*/ */
ir_node *new_Store (ir_node *store, ir_node *addr, ir_node *val); ir_node *new_Store(ir_node *store, ir_node *addr, ir_node *val, cons_flags flags);
/** Constructor for a Alloc node. /** Constructor for a Alloc node.
* *
......
...@@ -564,7 +564,7 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp) ...@@ -564,7 +564,7 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp)
if (is_atomic_type(param_type)) { if (is_atomic_type(param_type)) {
ir_node *store; ir_node *store;
ir_node *mem_input = do_seq ? curr_mem : new_NoMem(); ir_node *mem_input = do_seq ? curr_mem : new_NoMem();
store = new_rd_Store(dbgi, irg, bl, mem_input, addr, param); store = new_rd_Store(dbgi, irg, bl, mem_input, addr, param, 0);
mem = new_r_Proj(irg, bl, store, mode_M, pn_Store_M); mem = new_r_Proj(irg, bl, store, mode_M, pn_Store_M);
} }
...@@ -1616,7 +1616,7 @@ static void fix_address_of_parameter_access(be_abi_irg_t *env, ir_entity *value_ ...@@ -1616,7 +1616,7 @@ static void fix_address_of_parameter_access(be_abi_irg_t *env, ir_entity *value_
/* the backing store itself */ /* the backing store itself */
store = new_r_Store(irg, first_bl, mem, addr, store = new_r_Store(irg, first_bl, mem, addr,
new_r_Proj(irg, args_bl, args, mode, i)); new_r_Proj(irg, args_bl, args, mode, i), 0);
} }
/* the new memory Proj gets the last Proj from store */ /* the new memory Proj gets the last Proj from store */
set_Proj_pred(nmem, store); set_Proj_pred(nmem, store);
...@@ -1890,8 +1890,7 @@ static void modify_irg(be_abi_irg_t *env) ...@@ -1890,8 +1890,7 @@ static void modify_irg(be_abi_irg_t *env)
ir_mode *mode = get_type_mode(param_type); ir_mode *mode = get_type_mode(param_type);
ir_mode *load_mode = arg->load_mode; ir_mode *load_mode = arg->load_mode;
ir_node *load = new_r_Load(irg, reg_params_bl, new_NoMem(), addr, load_mode); ir_node *load = new_r_Load(irg, reg_params_bl, new_NoMem(), addr, load_mode, cons_floats);
set_irn_pinned(load, op_pin_state_floats);
repl = new_r_Proj(irg, reg_params_bl, load, load_mode, pn_Load_res); repl = new_r_Proj(irg, reg_params_bl, load, load_mode, pn_Load_res);
if (mode != load_mode) { if (mode != load_mode) {
...@@ -2126,9 +2125,8 @@ static void fix_pic_symconsts(ir_node *node, void *data) ...@@ -2126,9 +2125,8 @@ static void fix_pic_symconsts(ir_node *node, void *data)
/* we need an extra indirection for global data outside our current /* we need an extra indirection for global data outside our current
module. The loads are always safe and can therefore float module. The loads are always safe and can therefore float
and need no memory input */ and need no memory input */
load = new_r_Load(irg, block, new_NoMem(), add, mode); load = new_r_Load(irg, block, new_NoMem(), add, mode, cons_floats);
load_res = new_r_Proj(irg, block, load, mode, pn_Load_res); load_res = new_r_Proj(irg, block, load, mode, pn_Load_res);
set_irn_pinned(load, op_pin_state_floats);
set_irn_n(node, i, load_res); set_irn_n(node, i, load_res);
} }
......
...@@ -2308,17 +2308,17 @@ static ir_node *ia32_create_trampoline_fkt(ir_node *block, ir_node *mem, ir_node ...@@ -2308,17 +2308,17 @@ static ir_node *ia32_create_trampoline_fkt(ir_node *block, ir_node *mem, ir_node
ir_mode *mode = get_irn_mode(p); ir_mode *mode = get_irn_mode(p);
/* mov ecx,<env> */ /* mov ecx,<env> */
st = new_r_Store(irg, block, mem, p, new_Const_long(mode_Bu, 0xb9)); st = new_r_Store(irg, block, mem, p, new_Const_long(mode_Bu, 0xb9), 0);
mem = new_r_Proj(irg, block, st, mode_M, pn_Store_M); mem = new_r_Proj(irg, block, st, mode_M, pn_Store_M);
p = new_r_Add(irg, block, p, new_Const_long(mode_Iu, 1), mode); p = new_r_Add(irg, block, p, new_Const_long(mode_Iu, 1), mode);
st = new_r_Store(irg, block, mem, p, env); st = new_r_Store(irg, block, mem, p, env, 0);
mem = new_r_Proj(irg, block, st, mode_M, pn_Store_M); mem = new_r_Proj(irg, block, st, mode_M, pn_Store_M);
p = new_r_Add(irg, block, p, new_Const_long(mode_Iu, 4), mode); p = new_r_Add(irg, block, p, new_Const_long(mode_Iu, 4), mode);
/* jmp <callee> */ /* jmp <callee> */
st = new_r_Store(irg, block, mem, p, new_Const_long(mode_Bu, 0xe9)); st = new_r_Store(irg, block, mem, p, new_Const_long(mode_Bu, 0xe9), 0);
mem = new_r_Proj(irg, block, st, mode_M, pn_Store_M); mem = new_r_Proj(irg, block, st, mode_M, pn_Store_M);
p = new_r_Add(irg, block, p, new_Const_long(mode_Iu, 1), mode); p = new_r_Add(irg, block, p, new_Const_long(mode_Iu, 1), mode);
st = new_r_Store(irg, block, mem, p, callee); st = new_r_Store(irg, block, mem, p, callee, 0);
mem = new_r_Proj(irg, block, st, mode_M, pn_Store_M); mem = new_r_Proj(irg, block, st, mode_M, pn_Store_M);
p = new_r_Add(irg, block, p, new_Const_long(mode_Iu, 4), mode); p = new_r_Add(irg, block, p, new_Const_long(mode_Iu, 4), mode);
......
...@@ -1107,7 +1107,7 @@ static void create_abstract_load(ir_graph *irg, proc_t *proc, eff_t *eff) ...@@ -1107,7 +1107,7 @@ static void create_abstract_load(ir_graph *irg, proc_t *proc, eff_t *eff)
sel = addr -> firmnode; sel = addr -> firmnode;
mode = mode_ANY; mode = mode_ANY;
} }
load = new_Load(get_store(), sel, mode); load = new_Load(get_store(), sel, mode, 0);
set_store(new_Proj(load, mode_M, 0)); set_store(new_Proj(load, mode_M, 0));
eff -> firmnode = new_Proj(load, mode, 2); eff -> firmnode = new_Proj(load, mode, 2);
...@@ -1154,7 +1154,7 @@ static void create_abstract_store(ir_graph *irg, proc_t *proc, eff_t *eff) ...@@ -1154,7 +1154,7 @@ static void create_abstract_store(ir_graph *irg, proc_t *proc, eff_t *eff)
else { else {
sel = addr -> firmnode; sel = addr -> firmnode;
} }
store = new_Store(get_store(), sel, val -> firmnode); store = new_Store(get_store(), sel, val -> firmnode, 0);
set_store(new_Proj(store, mode_M, 0)); set_store(new_Proj(store, mode_M, 0));
eff -> firmnode = store; eff -> firmnode = store;
} }
......
...@@ -516,7 +516,7 @@ new_bd_Return(dbg_info *db, ir_node *block, ...@@ -516,7 +516,7 @@ new_bd_Return(dbg_info *db, ir_node *block,
static ir_node * static ir_node *
new_bd_Load(dbg_info *db, ir_node *block, new_bd_Load(dbg_info *db, ir_node *block,
ir_node *store, ir_node *adr, ir_mode *mode) { ir_node *store, ir_node *adr, ir_mode *mode, cons_flags flags) {
ir_node *in[2]; ir_node *in[2];
ir_node *res; ir_node *res;
ir_graph *irg = current_ir_graph; ir_graph *irg = current_ir_graph;
...@@ -524,10 +524,10 @@ new_bd_Load(dbg_info *db, ir_node *block, ...@@ -524,10 +524,10 @@ new_bd_Load(dbg_info *db, ir_node *block,
in[0] = store; in[0] = store;
in[1] = adr; in[1] = adr;
res = new_ir_node(db, irg, block, op_Load, mode_T, 2, in); res = new_ir_node(db, irg, block, op_Load, mode_T, 2, in);
res->attr.load.exc.pin_state = op_pin_state_pinned; res->attr.load.exc.pin_state = flags & cons_floats ? op_pin_state_floats : op_pin_state_pinned;
res->attr.load.load_mode = mode; res->attr.load.load_mode = mode;
res->attr.load.volatility = volatility_non_volatile; res->attr.load.volatility = flags & cons_volatile ? volatility_is_volatile : volatility_non_volatile;
res->attr.load.aligned = align_is_aligned; res->attr.load.aligned = flags & cons_unaligned ? align_non_aligned : align_is_aligned;
res = optimize_node(res); res = optimize_node(res);
IRN_VRFY_IRG(res, irg); IRN_VRFY_IRG(res, irg);
return res; return res;
...@@ -535,7 +535,7 @@ new_bd_Load(dbg_info *db, ir_node *block, ...@@ -535,7 +535,7 @@ new_bd_Load(dbg_info *db, ir_node *block,
static ir_node * static ir_node *
new_bd_Store(dbg_info *db, ir_node *block, new_bd_Store(dbg_info *db, ir_node *block,
ir_node *store, ir_node *adr, ir_node *val) { ir_node *store, ir_node *adr, ir_node *val, cons_flags flags) {
ir_node *in[3]; ir_node *in[3];
ir_node *res; ir_node *res;
ir_graph *irg = current_ir_graph; ir_graph *irg = current_ir_graph;
...@@ -544,9 +544,10 @@ new_bd_Store(dbg_info *db, ir_node *block, ...@@ -544,9 +544,10 @@ new_bd_Store(dbg_info *db, ir_node *block,
in[1] = adr; in[1] = adr;
in[2] = val; in[2] = val;
res = new_ir_node(db, irg, block, op_Store, mode_T, 3, in); res = new_ir_node(db, irg, block, op_Store, mode_T, 3, in);
res->attr.store.exc.pin_state = op_pin_state_pinned; res->attr.store.exc.pin_state = flags & cons_floats ? op_pin_state_floats : op_pin_state_pinned;
res->attr.store.volatility = volatility_non_volatile; res->attr.store.volatility = flags & cons_volatile ? volatility_is_volatile : volatility_non_volatile;
res->attr.store.aligned = align_is_aligned; res->attr.store.aligned = flags & cons_unaligned ? align_non_aligned : align_is_aligned;
res = optimize_node(res); res = optimize_node(res);
IRN_VRFY_IRG(res, irg); IRN_VRFY_IRG(res, irg);
return res; return res;
...@@ -1139,12 +1140,12 @@ new_rd_Return(dbg_info *db, ir_graph *irg, ir_node *block, ...@@ -1139,12 +1140,12 @@ new_rd_Return(dbg_info *db, ir_graph *irg, ir_node *block,
ir_node * ir_node *
new_rd_Load(dbg_info *db, ir_graph *irg, ir_node *block, new_rd_Load(dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *store, ir_node *adr, ir_mode *mode) { ir_node *store, ir_node *adr, ir_mode *mode, cons_flags flags) {
ir_node *res; ir_node *res;
ir_graph *rem = current_ir_graph; ir_graph *rem = current_ir_graph;
current_ir_graph = irg; current_ir_graph = irg;
res = new_bd_Load(db, block, store, adr, mode); res = new_bd_Load(db, block, store, adr, mode, flags);
current_ir_graph = rem; current_ir_graph = rem;
return res; return res;
...@@ -1152,12 +1153,12 @@ new_rd_Load(dbg_info *db, ir_graph *irg, ir_node *block, ...@@ -1152,12 +1153,12 @@ new_rd_Load(dbg_info *db, ir_graph *irg, ir_node *block,
ir_node * ir_node *
new_rd_Store(dbg_info *db, ir_graph *irg, ir_node *block, new_rd_Store(dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *store, ir_node *adr, ir_node *val) { ir_node *store, ir_node *adr, ir_node *val, cons_flags flags) {
ir_node *res; ir_node *res;
ir_graph *rem = current_ir_graph; ir_graph *rem = current_ir_graph;
current_ir_graph = irg; current_ir_graph = irg;
res = new_bd_Store(db, block, store, adr, val); res = new_bd_Store(db, block, store, adr, val, flags);
current_ir_graph = rem; current_ir_graph = rem;
return res; return res;
...@@ -1616,12 +1617,12 @@ ir_node *new_r_Phi(ir_graph *irg, ir_node *block, int arity, ...@@ -1616,12 +1617,12 @@ ir_node *new_r_Phi(ir_graph *irg, ir_node *block, int arity,
return new_rd_Phi(NULL, irg, block, arity, in, mode); return new_rd_Phi(NULL, irg, block, arity, in, mode);
} }
ir_node *new_r_Load(ir_graph *irg, ir_node *block, ir_node *new_r_Load(ir_graph *irg, ir_node *block,
ir_node *store, ir_node *adr, ir_mode *mode) { ir_node *store, ir_node *adr, ir_mode *mode, cons_flags flags) {
return new_rd_Load(NULL, irg, block, store, adr, mode); return new_rd_Load(NULL, irg, block, store, adr, mode, flags);
} }
ir_node *new_r_Store(ir_graph *irg, ir_node *block, ir_node *new_r_Store(ir_graph *irg, ir_node *block,
ir_node *store, ir_node *adr, ir_node *val) { ir_node *store, ir_node *adr, ir_node *val, cons_flags flags) {
return new_rd_Store(NULL, irg, block, store, adr, val); return new_rd_Store(NULL, irg, block, store, adr, val, flags);
} }
ir_node *new_r_Alloc(ir_graph *irg, ir_node *block, ir_node *store, ir_node *new_r_Alloc(ir_graph *irg, ir_node *block, ir_node *store,
ir_node *size, ir_type *alloc_type, ir_where_alloc where) { ir_node *size, ir_type *alloc_type, ir_where_alloc where) {
...@@ -2503,10 +2504,10 @@ new_d_Return(dbg_info *db, ir_node* store, int arity, ir_node **in) { ...@@ -2503,10 +2504,10 @@ new_d_Return(dbg_info *db, ir_node* store, int arity, ir_node **in) {
} /* new_d_Return */ } /* new_d_Return */
ir_node * ir_node *
new_d_Load(dbg_info *db, ir_node *store, ir_node *addr, ir_mode *mode) { new_d_Load(dbg_info *db, ir_node *store, ir_node *addr, ir_mode *mode, cons_flags flags) {
ir_node *res; ir_node *res;
res = new_bd_Load(db, current_ir_graph->current_block, res = new_bd_Load(db, current_ir_graph->current_block,
store, addr, mode); store, addr, mode, flags);
#if PRECISE_EXC_CONTEXT #if PRECISE_EXC_CONTEXT
firm_alloc_frag_arr(res, op_Load, &res->attr.load.exc.frag_arr); firm_alloc_frag_arr(res, op_Load, &res->attr.load.exc.frag_arr);
#endif #endif
...@@ -2515,10 +2516,10 @@ new_d_Load(dbg_info *db, ir_node *store, ir_node *addr, ir_mode *mode) { ...@@ -2515,10 +2516,10 @@ new_d_Load(dbg_info *db, ir_node *store, ir_node *addr, ir_mode *mode) {
} /* new_d_Load */ } /* new_d_Load */
ir_node * ir_node *
new_d_Store(dbg_info *db, ir_node *store, ir_node *addr, ir_node *val) { new_d_Store(dbg_info *db, ir_node *store, ir_node *addr, ir_node *val, cons_flags flags) {
ir_node *res; ir_node *res;
res = new_bd_Store(db, current_ir_graph->current_block, res = new_bd_Store(db, current_ir_graph->current_block,
store, addr, val); store, addr, val, flags);
#if PRECISE_EXC_CONTEXT #if PRECISE_EXC_CONTEXT
firm_alloc_frag_arr(res, op_Store, &res->attr.store.exc.frag_arr); firm_alloc_frag_arr(res, op_Store, &res->attr.store.exc.frag_arr);
#endif #endif
...@@ -3028,11 +3029,11 @@ ir_node *new_Cast(ir_node *op, ir_type *to_tp) { ...@@ -3028,11 +3029,11 @@ ir_node *new_Cast(ir_node *op, ir_type *to_tp) {
ir_node *new_Phi(int arity, ir_node **in, ir_mode *mode) { ir_node *new_Phi(int arity, ir_node **in, ir_mode *mode) {
return new_d_Phi(NULL, arity, in, mode); return new_d_Phi(NULL, arity, in, mode);
} }
ir_node *new_Load(ir_node *store, ir_node *addr, ir_mode *mode) { ir_node *new_Load(ir_node *store, ir_node *addr, ir_mode *mode, cons_flags flags) {
return new_d_Load(NULL, store, addr, mode); return new_d_Load(NULL, store, addr, mode, flags);
} }
ir_node *new_Store(ir_node *store, ir_node *addr, ir_node *val) { ir_node *new_Store(ir_node *store, ir_node *addr, ir_node *val, cons_flags flags) {
return new_d_Store(NULL, store, addr, val); return new_d_Store(NULL, store, addr, val, flags);
} }
ir_node *new_Alloc(ir_node *store, ir_node *size, ir_type *alloc_type, ir_node *new_Alloc(ir_node *store, ir_node *size, ir_type *alloc_type,
ir_where_alloc where) { ir_where_alloc where) {
......
...@@ -123,12 +123,12 @@ instrument_block(ir_node *bb, ir_node *address, unsigned int id) ...@@ -123,12 +123,12 @@ instrument_block(ir_node *bb, ir_node *address, unsigned int id)
unknown = new_r_Unknown(irg, mode_M); unknown = new_r_Unknown(irg, mode_M);
cnst = new_r_Const_long(irg, mode_Iu, get_mode_size_bytes(mode_Iu) * id); cnst = new_r_Const_long(irg, mode_Iu, get_mode_size_bytes(mode_Iu) * id);
offset = new_r_Add(irg, bb, address, cnst, get_modeP_data()); offset = new_r_Add(irg, bb, address, cnst, get_modeP_data());
load = new_r_Load(irg, bb, unknown, offset, mode_Iu); load = new_r_Load(irg, bb, unknown, offset, mode_Iu, 0);
projm = new_r_Proj(irg, bb, load, mode_M, pn_Load_M); projm = new_r_Proj(irg, bb, load, mode_M, pn_Load_M);
proji = new_r_Proj(irg, bb, load, mode_Iu, pn_Load_res); proji = new_r_Proj(irg, bb, load, mode_Iu, pn_Load_res);
cnst = new_r_Const_long(irg, mode_Iu, 1); cnst = new_r_Const_long(irg, mode_Iu, 1);
add = new_r_Add(irg, bb, proji, cnst, mode_Iu); add = new_r_Add(irg, bb, proji, cnst, mode_Iu);
store = new_r_Store(irg, bb, projm, offset, add); store = new_r_Store(irg, bb, projm, offset, add, 0);
projm = new_r_Proj(irg, bb, store, mode_M, pn_Store_M); projm = new_r_Proj(irg, bb, store, mode_M, pn_Store_M);
set_irn_link(bb, projm); set_irn_link(bb, projm);
set_irn_link(projm, load); set_irn_link(projm, load);
......
...@@ -101,14 +101,14 @@ static void lower_copyb_nodes(ir_node *irn, unsigned mode_bytes) { ...@@ -101,14 +101,14 @@ static void lower_copyb_nodes(ir_node *irn, unsigned mode_bytes) {
addr_const = new_r_Const_long(irg, mode_Iu, offset); addr_const = new_r_Const_long(irg, mode_Iu, offset);
add = new_r_Add(irg, block, addr_src, addr_const, addr_mode); add = new_r_Add(irg, block, addr_src, addr_const, addr_mode);
load = new_r_Load(irg, block, mem, add, mode); load = new_r_Load(irg, block, mem, add, mode, 0);
load_res = new_r_Proj(irg, block, load, mode, pn_Load_res); load_res = new_r_Proj(irg, block, load, mode, pn_Load_res);
load_mem = new_r_Proj(irg, block, load, mode_M, pn_Load_M); load_mem = new_r_Proj(irg, block, load, mode_M, pn_Load_M);
addr_const = new_r_Const_long(irg, mode_Iu, offset); addr_const = new_r_Const_long(irg, mode_Iu, offset);
add = new_r_Add(irg, block, addr_dst, addr_const, addr_mode); add = new_r_Add(irg, block, addr_dst, addr_const, addr_mode);
store = new_r_Store(irg, block, mem, add, load_res); store = new_r_Store(irg, block, mem, add, load_res, 0);
store_mem = new_r_Proj(irg, block, store, mode_M, pn_Store_M); store_mem = new_r_Proj(irg, block, store, mode_M, pn_Store_M);
mem = store_mem; mem = store_mem;
......
...@@ -356,14 +356,16 @@ static void lower_Const(ir_node *node, ir_mode *mode, lower_env_t *env) { ...@@ -356,14 +356,16 @@ static void lower_Const(ir_node *node, ir_mode *mode, lower_env_t *env) {
* Translate a Load: create two. * Translate a Load: create two.
*/ */
static void lower_Load(ir_node *node, ir_mode *mode, lower_env_t *env) { static void lower_Load(ir_node *node, ir_mode *mode, lower_env_t *env) {
ir_mode *low_mode = env->params->low_unsigned; ir_mode *low_mode = env->params->low_unsigned;
ir_graph *irg = current_ir_graph; ir_graph *irg = current_ir_graph;
ir_node *adr = get_Load_ptr(node); ir_node *adr = get_Load_ptr(node);
ir_node *mem = get_Load_mem(node); ir_node *mem = get_Load_mem(node);
ir_node *low, *high, *proj; ir_node *low, *high, *proj;
dbg_info *dbg; dbg_info *dbg;
ir_node *block = get_nodes_block(node); ir_node *block = get_nodes_block(node);
int idx; int idx;
cons_flags volatility = get_Load_volatility(node) == volatility_is_volatile
? cons_volatile : 0;
if (env->params->little_endian) { if (env->params->little_endian) {
low = adr; low = adr;
...@@ -379,12 +381,9 @@ static void lower_Load(ir_node *node, ir_mode *mode, lower_env_t *env) { ...