+ EXPR to the value set for value VAL. */
+
+void
+vn_add (tree expr, tree val)
+{
+ switch (TREE_CODE_CLASS (TREE_CODE (expr)))
+ {
+ case tcc_comparison:
+ case tcc_binary:
+ vn_binary_op_insert (expr, val);
+ break;
+ case tcc_unary:
+ vn_unary_op_insert (expr, val);
+ break;
+ /* In the case of array-refs of constants, for example, we can
+ end up with no vuses. */
+ case tcc_reference:
+ vn_reference_insert (expr, val, NULL);
+ break;
+ /* The *only* time CALL_EXPR should appear here is
+ when it has no vuses. */
+ case tcc_vl_exp:
+ case tcc_exceptional:
+ case tcc_expression:
+ case tcc_declaration:
+ if (TREE_CODE (expr) == CALL_EXPR || DECL_P (expr))
+ {
+ vn_reference_insert (expr, val, NULL);
+ break;
+ }
+ else if (TREE_CODE (expr) == SSA_NAME)
+ {
+ SSA_NAME_VALUE (expr) = val;
+ break;
+ }
+ else if (TREE_CODE (expr) == ADDR_EXPR)
+ {
+ vn_unary_op_insert (expr, val);
+ break;
+ }
+ /* FALLTHROUGH */
+ default:
+ gcc_unreachable ();
+ }
+ set_value_handle (expr, val);
+ if (TREE_CODE (val) == VALUE_HANDLE)
+ add_to_value (val, expr);
+}
+
+/* Insert EXPR into the value numbering tables. with value VAL, and
+ add expression EXPR to the value set for value VAL. VUSES
+ represents the virtual use operands associated with EXPR. It is
+ used when computing a hash value for EXPR. */