summaryrefslogtreecommitdiff
path: root/gcc/conflict.c
diff options
context:
space:
mode:
authorsamuel <samuel@138bc75d-0d04-0410-961f-82ee72b054a4>2000-04-07 08:16:31 +0000
committersamuel <samuel@138bc75d-0d04-0410-961f-82ee72b054a4>2000-04-07 08:16:31 +0000
commit14190deb4d00f39bba8c74fcf166d08b21c30e61 (patch)
tree2f24d8de38b69abb4dd23349b4e66e1a4932fb5a /gcc/conflict.c
parent7bde1fce1eded92fcbba22c439dc3c31017e0bbb (diff)
downloadgcc-14190deb4d00f39bba8c74fcf166d08b21c30e61.tar.gz
* ssa.c (compute_conservative_reg_partition): Declare with
void arguments. * toplev.c (clean_dump_file): Remove previously-deleted function inadvertantly merged back in. * conflict.c (conflict_graph_add): Use a single call to htab_find_slot to look up and insert. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32992 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/conflict.c')
-rw-r--r--gcc/conflict.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/gcc/conflict.c b/gcc/conflict.c
index 51851a2b1b5..667a18a672c 100644
--- a/gcc/conflict.c
+++ b/gcc/conflict.c
@@ -201,21 +201,20 @@ conflict_graph_add (graph, reg1, reg2)
{
int smaller = MIN (reg1, reg2);
int larger = MAX (reg1, reg2);
+ struct conflict_graph_arc_def dummy;
conflict_graph_arc arc;
- void **hash_table_slot;
+ void **slot;
/* A reg cannot conflict with itself. */
if (reg1 == reg2)
abort ();
- /* If the conflict is already there, do nothing.
-
- FIXME: This is a little wastful; it would be faster to look up the
- conflict in the hash table, returning it if it exists and
- inserting a new entry if it doesn't, all in one operation. This
- would save an extra hash lookup. However, the hashtab interface
- doesn't really allow this right now. */
- if (conflict_graph_conflict_p (graph, reg1, reg2))
+ dummy.smaller = smaller;
+ dummy.larger = larger;
+ slot = htab_find_slot (graph->arc_hash_table, (void *) &dummy, 1);
+
+ /* If the conflict is already there, do nothing. */
+ if (*slot != NULL)
return 0;
/* Allocate an arc. */
@@ -234,9 +233,7 @@ conflict_graph_add (graph, reg1, reg2)
graph->neighbor_heads[larger] = arc;
/* Put it in the hash table. */
- hash_table_slot = htab_find_slot (graph->arc_hash_table,
- (void *) arc, 1);
- *hash_table_slot = (void *) arc;
+ *slot = (void *) arc;
return 1;
}
@@ -532,4 +529,3 @@ conflict_graph_compute (regs, p)
return graph;
}
-