3 * File name: ir/ir/iropt_t.h
4 * Purpose: iropt --- optimizations intertwined with IR construction -- private header.
5 * Author: Martin Trapp, Christian Schaefer
6 * Modified by: Goetz Lindenmaier
9 * Copyright: (c) 1998-2003 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
16 * Declarations for optimizations intertwined with IR construction.
18 * @author Martin Trapp, Christian Schaefer
28 ir_node *equivalent_node (ir_node *n);
33 pset *new_identities (void);
34 void del_identities (pset *value_table);
35 void add_identities (pset *value_table, ir_node *node);
38 ir_node *optimize_node (ir_node *n);
40 ir_node *optimize_in_place_2 (ir_node *n);
42 /** Calculate a hash value of a node. */
43 unsigned ir_node_hash (ir_node *node);
46 * Compare function for two nodes in the hash table. Gets two
47 * nodes as parameters. Returns 0 if the nodes are a cse.
49 int identities_cmp(const void *elt, const void *key);
52 * Return the canonical node computing the same value as n.
53 * Looks up the node in a hash table, enters it in the table
54 * if it isn't there yet.
56 ir_node *identify_remember(pset *value_table, ir_node *n);
59 * Returns the tarval of a Const node or tarval_bad for all other nodes.
61 static INLINE tarval *
62 value_of(ir_node *n) {
63 if ((n != NULL) && (get_irn_op(n) == op_Const))
64 return get_Const_tarval(n); /* might return tarval_bad */
70 * Sets the default operation for an ir_op_ops.
72 * @param code the opcode for the default operation
73 * @param ops the operations initialized
78 ir_op_ops *firm_set_default_operations(opcode code, ir_op_ops *ops);
80 # endif /* _IROPT_T_H_ */