Fixed wrong array declaration
[libfirm] / ir / opt / opt_confirms.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/opt/opt_confirms.h
4  * Purpose:     Optimizations regarding Confirm nodes
5  * Author:      Michael Beck
6  * Modified by:
7  * Created:
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 1998-2005 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12 #ifndef _OPT_CONFIRMS_H_
13 #define _OPT_CONFIRMS_H_
14
15 #include "irnode.h"
16
17 /**
18  * @file opt_confirms.h
19  *
20  * Optimizations regarding Confirm nodes.
21  * These optimiztions are not means to be run from
22  * frontends, they are called from iropt.
23  */
24
25 /**
26  * Possible return values of value_classify().
27  */
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 */
33 } value_classify;
34
35 /**
36  * Check, if the value of a node is != 0.
37  *
38  * This is a often needed case, so we handle here Confirm
39  * nodes too.
40  *
41  * @param n  a node representing the value
42  */
43 int value_not_zero(ir_node *n);
44
45 /**
46  * Check, if the value of a node cannot represent a NULL pointer.
47  *
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
52  *
53  * @param n  a node representing the value
54  */
55 int value_not_null(ir_node *n);
56
57 /**
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.
61  *
62  * @param n  a node representing the value
63  */
64 value_classify classify_value_sign(ir_node *n);
65
66 /**
67  * Return the value of a Cmp if one or both predecessors
68  * are Confirm nodes.
69  *
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
74  */
75 tarval *computed_value_Cmp_Confirm(ir_node *cmp, ir_node *left, ir_node *right, pn_Cmp pnc);
76
77 #endif /* _OPT_CONFIRMS_H_ */