used new set_irg_doms_inconsistent() to invalidate dom and postdom
[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 is != NULL.
47  *
48  * This is a often needed case, so we handle here Confirm
49  * nodes too.
50  *
51  * @param n  a node representing the value
52  */
53 int value_not_null(ir_node *n);
54
55 /**
56  * Check, if the value of a node can be confirmed >= 0 or <= 0,
57  * If the mode of the value did not honor signed zeros, else
58  * check for >= 0 or < 0.
59  *
60  * @param n  a node representing the value
61  */
62 value_classify classify_value_sign(ir_node *n);
63
64 /**
65  * Return the value of a Cmp if one or both predecessors
66  * are Confirm nodes.
67  *
68  * @param cmp    the compare node that will be evaluated
69  * @param left   the left operand of the Cmp
70  * @param right  the right operand of the Cmp
71  * @param pnc    the compare relation
72  */
73 tarval *computed_value_Cmp_Confirm(ir_node *cmp, ir_node *left, ir_node *right, pn_Cmp pnc);
74
75 #endif /* _OPT_CONFIRMS_H_ */