3 * File name: ir/opt/opt_confirms.h
4 * Purpose: Optimizations regarding Confirm nodes
9 * Copyright: (c) 1998-2005 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
12 #ifndef _OPT_CONFIRMS_H_
13 #define _OPT_CONFIRMS_H_
18 * @file opt_confirms.h
20 * Optimizations regarding Confirm nodes.
21 * These optimiztions are not means to be run from
22 * frontends, they are called from iropt.
26 * Possible return values of value_classify().
28 typedef enum _value_classify {
29 VALUE_UNKNOWN = 0, /**< could not classify */
30 VALUE_POSITIVE = 1, /**< value is positive, i.e. >= 0 */
31 VALUE_NEGATIVE = -1 /**< value is negative, i.e. <= 0 if
32 no signed zero exists or < 0 else */
36 * Check, if the value of a node is != 0.
38 * This is a often needed case, so we handle here Confirm
41 * @param n a node representing the value
43 int value_not_zero(ir_node *n);
46 * Check, if the value of a node cannot represent a NULL pointer.
48 * - If sel_based_null_check_elim is enabled, all
49 * Sel nodes can be skipped.
50 * - A SymConst(entity) is NEVER a NULL pointer
51 * - Confirms are evaluated
53 * @param n a node representing the value
55 int value_not_null(ir_node *n);
58 * Check, if the value of a node can be confirmed >= 0 or <= 0,
59 * If the mode of the value did not honor signed zeros, else
60 * check for >= 0 or < 0.
62 * @param n a node representing the value
64 value_classify classify_value_sign(ir_node *n);
67 * Return the value of a Cmp if one or both predecessors
70 * @param cmp the compare node that will be evaluated
71 * @param left the left operand of the Cmp
72 * @param right the right operand of the Cmp
73 * @param pnc the compare relation
75 tarval *computed_value_Cmp_Confirm(ir_node *cmp, ir_node *left, ir_node *right, pn_Cmp pnc);
77 #endif /* _OPT_CONFIRMS_H_ */