Commit a2427651 authored by Christian Würdig's avatar Christian Würdig
Browse files

removed memory input from consts

const are now placed in smallest common dominator block of all it's users
constants have dependency to barrier
parent eda38c30
......@@ -108,12 +108,12 @@ static ir_node *gen_SymConst(ia32_transform_env_t *env) {
if (mode_is_float(mode)) {
FP_USED(env->cg);
if (USE_SSE2(env->cg))
cnst = new_rd_ia32_xConst(dbg, irg, block, get_irg_no_mem(irg), mode);
cnst = new_rd_ia32_xConst(dbg, irg, block, mode);
else
cnst = new_rd_ia32_vfConst(dbg, irg, block, get_irg_no_mem(irg), mode);
cnst = new_rd_ia32_vfConst(dbg, irg, block, mode);
}
else
cnst = new_rd_ia32_Const(dbg, irg, block, get_irg_no_mem(irg), mode);
cnst = new_rd_ia32_Const(dbg, irg, block, mode);
set_ia32_Const_attr(cnst, env->irn);
......@@ -213,13 +213,16 @@ static ir_node *gen_Const(ia32_transform_env_t *env) {
env->irn = cnst;
env->mode = mode_P;
cnst = gen_SymConst(env);
add_irn_dep(cnst, be_abi_get_start_barrier(env->cg->birg->abi));
set_Load_ptr(get_Proj_pred(load), cnst);
cnst = load;
}
else {
cnst = new_rd_ia32_Const(dbg, irg, block, get_irg_no_mem(irg), get_irn_mode(node));
cnst = new_rd_ia32_Const(dbg, irg, block, get_irn_mode(node));
add_irn_dep(cnst, be_abi_get_start_barrier(env->cg->birg->abi));
set_ia32_Const_attr(cnst, node);
}
return cnst;
}
......@@ -241,13 +244,15 @@ static void ia32_transform_const(ir_node *irn, void *env) {
tenv.irn = irn;
DEBUG_ONLY(tenv.mod = cg->mod;)
#if 0
#if 1
/* place const either in the smallest dominator of all its users or the original block */
if (cg->opt & IA32_OPT_PLACECNST)
tenv.block = node_users_smallest_common_dominator(irn, 1);
else
tenv.block = get_nodes_block(irn);
#else
/* Actually, there is no real sense in placing */
/* the Consts in the successor of the start block. */
{
ir_node *afterstart = NULL;
ir_node *startblock = get_irg_start_block(tenv.irg);
......@@ -288,7 +293,7 @@ static void ia32_transform_const(ir_node *irn, void *env) {
static void ia32_place_consts_walker(ir_node *irn, void *env) {
ia32_code_gen_t *cg = env;
if(!is_Const(irn) && !is_SymConst(irn))
if (! is_Const(irn) && ! is_SymConst(irn))
return;
ia32_transform_const(irn, cg);
......
......@@ -657,7 +657,7 @@ else {
"irn_flags" => "R",
"comment" => "represents an integer constant",
"cmp_attr" => " return ia32_compare_immop_attr(attr_a, attr_b);\n",
"reg_req" => { "in" => [ "none" ], "out" => [ "gp" ] },
"reg_req" => { "out" => [ "gp" ] },
},
"Cdq" => {
......@@ -928,7 +928,7 @@ else {
"irn_flags" => "R",
"comment" => "represents a SSE constant",
"cmp_attr" => " return ia32_compare_immop_attr(attr_a, attr_b);\n",
"reg_req" => { "in" => [ "none" ], "out" => [ "xmm" ] },
"reg_req" => { "out" => [ "xmm" ] },
"emit" => '. movs%M %D1, %C /* Load fConst into register */',
"latency" => 2,
},
......@@ -1346,7 +1346,7 @@ else {
"init_attr" => " set_ia32_ls_mode(res, mode);",
"comment" => "represents a virtual floating point constant",
"cmp_attr" => " return ia32_compare_immop_attr(attr_a, attr_b);\n",
"reg_req" => { "in" => [ "none" ], "out" => [ "vfp" ] },
"reg_req" => { "out" => [ "vfp" ] },
"latency" => 3,
},
......
......@@ -1016,7 +1016,8 @@ static ir_node *generate_DivMod(ia32_transform_env_t *env, ir_node *dividend, ir
edx_node = new_rd_Proj(dbg, irg, block, cltd, mode_Is, pn_ia32_Cdq_EDX);
}
else {
edx_node = new_rd_ia32_Const(dbg, irg, block, get_irg_no_mem(irg), mode_Iu);
edx_node = new_rd_ia32_Const(dbg, irg, block, mode_Iu);
add_irn_dep(edx_node, be_abi_get_start_barrier(env->cg->birg->abi));
set_ia32_Const_type(edx_node, ia32_Const);
set_ia32_Immop_tarval(edx_node, get_tarval_null(mode_Iu));
}
......@@ -1749,7 +1750,8 @@ static ir_node *gen_CopyB(ia32_transform_env_t *env) {
rem = size & 0x3; /* size % 4 */
size >>= 2;
res = new_rd_ia32_Const(dbg, irg, block, get_irg_no_mem(irg), mode_Is);
res = new_rd_ia32_Const(dbg, irg, block, mode_Is);
add_irn_dep(res, be_abi_get_start_barrier(env->cg->birg->abi));
set_ia32_op_type(res, ia32_Const);
set_ia32_Immop_tarval(res, new_tarval_from_long(size, mode_Is));
......
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