3 * File name: ir/opt/opt_confirms.h
4 * Purpose: Optimizations regarding Confirm nodes
9 * Copyright: (c) 1998-2005 Universität Karlsruhe
10 * License: 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 optimizations are not means to be run from
22 * frontends, they are called from iropt.
26 * Check, if the value of a node is != 0.
28 * This is a often needed case, so we handle here Confirm
31 * @param n a node representing the value
32 * @param confirm if n is confirmed to be != 0, returns
33 * the the Confirm-node, else NULL
35 int value_not_zero(ir_node *n, ir_node **confirm);
38 * Check, if the value of a node cannot represent a NULL pointer.
40 * - If sel_based_null_check_elim is enabled, all
41 * Sel nodes can be skipped.
42 * - A SymConst(entity) is NEVER a NULL pointer
43 * - A Const != NULL is NEVER a NULL pointer
44 * - Confirms are evaluated
46 * @param n a node representing the value
47 * @param confirm if n is confirmed to be != NULL, returns
48 * the the Confirm-node, else NULL
50 int value_not_null(ir_node *n, ir_node **confirm);
53 * Possible return values of value_classify().
55 typedef enum _value_classify_sign {
56 value_classified_unknown = 0, /**< could not classify */
57 value_classified_positive = 1, /**< value is positive, i.e. >= 0 */
58 value_classified_negative = -1 /**< value is negative, i.e. <= 0 if
59 no signed zero exists or < 0 else */
60 } value_classify_sign;
63 * Check, if the value of a node can be confirmed >= 0 or <= 0,
64 * If the mode of the value did not honor signed zeros, else
65 * check for >= 0 or < 0.
67 * @param n a node representing the value
69 value_classify_sign classify_value_sign(ir_node *n);
72 * Return the value of a Cmp if one or both predecessors
75 * @param cmp the compare node that will be evaluated
76 * @param left the left operand of the Cmp
77 * @param right the right operand of the Cmp
78 * @param pnc the compare relation
80 tarval *computed_value_Cmp_Confirm(ir_node *cmp, ir_node *left, ir_node *right, pn_Cmp pnc);
82 #endif /* _OPT_CONFIRMS_H_ */