X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Fvrp.h;h=ef5234b4515e67bd3fbdfff2acce827d81265e05;hb=8b9cffd15955b08311c41c37cd06acd7db3bd7f4;hp=1ffb44e5c8aa3032df20ab5c262e7f19dc0085c3;hpb=fc329341013e13fcb6ae6965022951278f8646e2;p=libfirm diff --git a/include/libfirm/vrp.h b/include/libfirm/vrp.h index 1ffb44e5c..ef5234b45 100644 --- a/include/libfirm/vrp.h +++ b/include/libfirm/vrp.h @@ -21,63 +21,73 @@ * @file * @brief Analyse the graph with value range propagation * @author Jonas Fietz - * @version $Id$ - * */ -#include "firm_types.h" - #ifndef VRP_H #define VRP_H +#include "firm_types.h" +#include "begin.h" + +/** + * @ingroup irana + * @defgroup vrp Value Information + * Information about SSA-values (ranges, known bits, ...) + * @{ + */ + +/** Type of a value range */ enum range_types { VRP_UNDEFINED, /**< No information could be derived so far */ VRP_RANGE, /**< bottom and top form a range, including both values */ - VRP_ANTIRANGE, /**< range from bottom to top can not be, but borders might - be */ - VRP_VARYING /**< information can not be derived */ + VRP_ANTIRANGE, /**< range from bottom to top cannot be, but borders might + be */ + VRP_VARYING /**< information cannot be derived */ }; -/** VRP information */ +/** VRP information for a single node */ typedef struct { - int valid; /**< This node has valid vrp information */ - tarval *bits_set; /**< The bits which, by analysis, are definitely set. - 0: may be not set, 1: definitely set*/ - tarval *bits_not_set; /**< The bits which by analysis are definitely - not set, 1 for may be set, 0: definitely not set */ + ir_tarval *bits_set; /**< The bits which, by analysis, are + definitely set: + 0: may be not set, 1: definitely set */ + ir_tarval *bits_not_set; /**< The bits which by analysis are definitely + not set: + 1 for may be set, 0: definitely not set */ enum range_types range_type; /**< The range represented by range_top, range_bottom */ - tarval *range_bottom, *range_top; + ir_tarval *range_bottom; /**< lower end of the value range */ + ir_tarval *range_top; /**< upper end of the value range */ } vrp_attr; /** - * Set vrp data on the graph irg + * Sets vrp data on the graph irg * @param irg graph on which to set vrp data */ -void set_vrp_data(ir_graph *irg); +FIRM_API void set_vrp_data(ir_graph *irg); /** - * Creates an ir_prog_pass for vrp - * - * @param name the name of this pass or NULL + * free vrp infos in an irg */ -ir_graph_pass_t *set_vrp_pass(const char *name); +FIRM_API void free_vrp_data(ir_graph *irg); /** * Test, if the two nodes can be compared with their vrp information * * @param left: the left node * @param right: the right node - * - * @return the pn_Cmp, if one can be derived + * @return all possible relations */ -pn_Cmp vrp_cmp(const ir_node *left, const ir_node *right); +FIRM_API ir_relation vrp_cmp(const ir_node *left, const ir_node *right); -/* - * Return the vrp data for this node +/** + * Returns the vrp data for this node + * Note: only allowed for nodes with an integer mode! * * @param n: the node for which to return the vrp information - * * @return a pointer to the vrp data or NULL if there is none */ -vrp_attr *vrp_get_info(const ir_node *n); +FIRM_API vrp_attr *vrp_get_info(const ir_node *n); + +/** @} */ + +#include "end.h" #endif