aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-01-11 13:36:53 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-01-11 13:36:53 +0000
commit8d0eca24faee76ac0ebc169695e4a79f390a5316 (patch)
tree0c2eb0c12ff7e6f1df85bd4a8935956adc003fb3
parent245af66d33bee358798bcc814f4ed45ad72cf4e5 (diff)
downloadgcc-8d0eca24faee76ac0ebc169695e4a79f390a5316.zip
gcc-8d0eca24faee76ac0ebc169695e4a79f390a5316.tar.gz
gcc-8d0eca24faee76ac0ebc169695e4a79f390a5316.tar.bz2
tree-ssa-sccvn.c (struct vn_binary_op_s): Move hashcode near opcode.
2008-01-11 Richard Guenther <rguenther@suse.de> * tree-ssa-sccvn.c (struct vn_binary_op_s): Move hashcode near opcode. (struct vn_unary_op_s): Likewise. (vn_reference_insert): Free old reference on hash collision. From-SVN: r131462
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-sccvn.c42
2 files changed, 29 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0e5dbd6..7d9f5e7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-11 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-sccvn.c (struct vn_binary_op_s): Move hashcode near opcode.
+ (struct vn_unary_op_s): Likewise.
+ (vn_reference_insert): Free old reference on hash collision.
+
2008-01-10 Raksit Ashok <raksit@google.com>
PR rtl-optimization/27971
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index e1d4af1..7f566db 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -125,10 +125,10 @@ typedef struct vn_tables_s
typedef struct vn_binary_op_s
{
enum tree_code opcode;
+ hashval_t hashcode;
tree type;
tree op0;
tree op1;
- hashval_t hashcode;
tree result;
} *vn_binary_op_t;
typedef const struct vn_binary_op_s *const_vn_binary_op_t;
@@ -140,9 +140,9 @@ typedef const struct vn_binary_op_s *const_vn_binary_op_t;
typedef struct vn_unary_op_s
{
enum tree_code opcode;
+ hashval_t hashcode;
tree type;
tree op0;
- hashval_t hashcode;
tree result;
} *vn_unary_op_t;
typedef const struct vn_unary_op_s *const_vn_unary_op_t;
@@ -280,6 +280,24 @@ VN_INFO_GET (tree name)
}
+/* Free a phi operation structure VP. */
+
+static void
+free_phi (void *vp)
+{
+ vn_phi_t phi = vp;
+ VEC_free (tree, heap, phi->phiargs);
+}
+
+/* Free a reference operation structure VP. */
+
+static void
+free_reference (void *vp)
+{
+ vn_reference_t vr = vp;
+ VEC_free (vn_reference_op_s, heap, vr->operands);
+}
+
/* Compare two reference operands P1 and P2 for equality. return true if
they are equal, and false otherwise. */
@@ -691,6 +709,9 @@ vn_reference_insert (tree op, tree result, VEC (tree, gc) *vuses)
the other lookup functions, you cannot gcc_assert (!*slot)
here. */
+ /* But free the old slot in case of a collision. */
+ if (*slot)
+ free_reference (*slot);
*slot = vr1;
}
@@ -1927,23 +1948,6 @@ DFS (tree name)
return true;
}
-static void
-free_phi (void *vp)
-{
- vn_phi_t phi = vp;
- VEC_free (tree, heap, phi->phiargs);
-}
-
-
-/* Free a reference operation structure VP. */
-
-static void
-free_reference (void *vp)
-{
- vn_reference_t vr = vp;
- VEC_free (vn_reference_op_s, heap, vr->operands);
-}
-
/* Allocate a value number table. */
static void