genattrtab.c (struct attr_value_list, [...]): Move to file scope from optimize_attrs.
* genattrtab.c (struct attr_value_list, insn_code_values): Move to file scope from optimize_attrs. (simplify_test_exp): If insn_code_values is not NULL, use it to speed up search. (optimize_attrs): Clear insn_code_values after freeing it. From-SVN: r121216
This commit is contained in:
parent
7969a3791e
commit
e2e3023612
|
@ -1,3 +1,11 @@
|
||||||
|
2007-01-27 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* genattrtab.c (struct attr_value_list, insn_code_values): Move to
|
||||||
|
file scope from optimize_attrs.
|
||||||
|
(simplify_test_exp): If insn_code_values is not NULL, use it to speed
|
||||||
|
up search.
|
||||||
|
(optimize_attrs): Clear insn_code_values after freeing it.
|
||||||
|
|
||||||
2007-01-26 Zdenek Dvorak <dvorakz@suse.cz>
|
2007-01-26 Zdenek Dvorak <dvorakz@suse.cz>
|
||||||
|
|
||||||
* tree-ssa-address.c (create_mem_ref): Remove ", bsi" from
|
* tree-ssa-address.c (create_mem_ref): Remove ", bsi" from
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* Generate code from machine description to compute values of attributes.
|
/* Generate code from machine description to compute values of attributes.
|
||||||
Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998,
|
Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998,
|
||||||
1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
|
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
|
||||||
|
|
||||||
This file is part of GCC.
|
This file is part of GCC.
|
||||||
|
@ -189,6 +189,14 @@ struct delay_desc
|
||||||
int lineno; /* Line number. */
|
int lineno; /* Line number. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct attr_value_list
|
||||||
|
{
|
||||||
|
struct attr_value *av;
|
||||||
|
struct insn_ent *ie;
|
||||||
|
struct attr_desc *attr;
|
||||||
|
struct attr_value_list *next;
|
||||||
|
};
|
||||||
|
|
||||||
/* Listheads of above structures. */
|
/* Listheads of above structures. */
|
||||||
|
|
||||||
/* This one is indexed by the first character of the attribute name. */
|
/* This one is indexed by the first character of the attribute name. */
|
||||||
|
@ -196,6 +204,7 @@ struct delay_desc
|
||||||
static struct attr_desc *attrs[MAX_ATTRS_INDEX];
|
static struct attr_desc *attrs[MAX_ATTRS_INDEX];
|
||||||
static struct insn_def *defs;
|
static struct insn_def *defs;
|
||||||
static struct delay_desc *delays;
|
static struct delay_desc *delays;
|
||||||
|
struct attr_value_list **insn_code_values;
|
||||||
|
|
||||||
/* Other variables. */
|
/* Other variables. */
|
||||||
|
|
||||||
|
@ -2448,6 +2457,7 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index)
|
||||||
struct attr_desc *attr;
|
struct attr_desc *attr;
|
||||||
struct attr_value *av;
|
struct attr_value *av;
|
||||||
struct insn_ent *ie;
|
struct insn_ent *ie;
|
||||||
|
struct attr_value_list *iv;
|
||||||
int i;
|
int i;
|
||||||
rtx newexp = exp;
|
rtx newexp = exp;
|
||||||
bool left_alt, right_alt;
|
bool left_alt, right_alt;
|
||||||
|
@ -2718,16 +2728,36 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index)
|
||||||
would give this insn the values being tested for. */
|
would give this insn the values being tested for. */
|
||||||
if (insn_code >= 0
|
if (insn_code >= 0
|
||||||
&& (attr = find_attr (&XSTR (exp, 0), 0)) != NULL)
|
&& (attr = find_attr (&XSTR (exp, 0), 0)) != NULL)
|
||||||
|
{
|
||||||
|
rtx x;
|
||||||
|
|
||||||
|
av = NULL;
|
||||||
|
if (insn_code_values)
|
||||||
|
{
|
||||||
|
for (iv = insn_code_values[insn_code]; iv; iv = iv->next)
|
||||||
|
if (iv->attr == attr)
|
||||||
|
{
|
||||||
|
av = iv->av;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
for (av = attr->first_value; av; av = av->next)
|
for (av = attr->first_value; av; av = av->next)
|
||||||
for (ie = av->first_insn; ie; ie = ie->next)
|
for (ie = av->first_insn; ie; ie = ie->next)
|
||||||
if (ie->def->insn_code == insn_code)
|
if (ie->def->insn_code == insn_code)
|
||||||
|
goto got_av;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (av)
|
||||||
{
|
{
|
||||||
rtx x;
|
got_av:
|
||||||
x = evaluate_eq_attr (exp, av->value, insn_code, insn_index);
|
x = evaluate_eq_attr (exp, av->value, insn_code, insn_index);
|
||||||
x = SIMPLIFY_TEST_EXP (x, insn_code, insn_index);
|
x = SIMPLIFY_TEST_EXP (x, insn_code, insn_index);
|
||||||
if (attr_rtx_cost(x) < 20)
|
if (attr_rtx_cost(x) < 20)
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -2756,14 +2786,6 @@ optimize_attrs (void)
|
||||||
struct insn_ent *ie;
|
struct insn_ent *ie;
|
||||||
rtx newexp;
|
rtx newexp;
|
||||||
int i;
|
int i;
|
||||||
struct attr_value_list
|
|
||||||
{
|
|
||||||
struct attr_value *av;
|
|
||||||
struct insn_ent *ie;
|
|
||||||
struct attr_desc *attr;
|
|
||||||
struct attr_value_list *next;
|
|
||||||
};
|
|
||||||
struct attr_value_list **insn_code_values;
|
|
||||||
struct attr_value_list *ivbuf;
|
struct attr_value_list *ivbuf;
|
||||||
struct attr_value_list *iv;
|
struct attr_value_list *iv;
|
||||||
|
|
||||||
|
@ -2840,6 +2862,7 @@ optimize_attrs (void)
|
||||||
|
|
||||||
free (ivbuf);
|
free (ivbuf);
|
||||||
free (insn_code_values - 2);
|
free (insn_code_values - 2);
|
||||||
|
insn_code_values = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear the ATTR_CURR_SIMPLIFIED_P flag in EXP and its subexpressions. */
|
/* Clear the ATTR_CURR_SIMPLIFIED_P flag in EXP and its subexpressions. */
|
||||||
|
|
Loading…
Reference in New Issue