+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
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;
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;
}
+/* 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. */
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;
}
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