2 * This file is part of libFirm.
3 * Copyright (C) 2012 University of Karlsruhe.
8 * @brief Analyse the graph with value range propagation
14 #include "firm_types.h"
19 * @defgroup vrp Value Information
20 * Information about SSA-values (ranges, known bits, ...)
24 /** Type of a value range */
26 VRP_UNDEFINED, /**< No information could be derived so far */
27 VRP_RANGE, /**< bottom and top form a range, including both values */
28 VRP_ANTIRANGE, /**< range from bottom to top cannot be, but borders might
30 VRP_VARYING /**< information cannot be derived */
33 /** VRP information for a single node */
35 ir_tarval *bits_set; /**< The bits which, by analysis, are
37 0: may be not set, 1: definitely set */
38 ir_tarval *bits_not_set; /**< The bits which by analysis are definitely
40 1 for may be set, 0: definitely not set */
41 enum range_types range_type; /**< The range represented by range_top, range_bottom */
42 ir_tarval *range_bottom; /**< lower end of the value range */
43 ir_tarval *range_top; /**< upper end of the value range */
47 * Sets vrp data on the graph irg
48 * @param irg graph on which to set vrp data
50 FIRM_API void set_vrp_data(ir_graph *irg);
53 * free vrp infos in an irg
55 FIRM_API void free_vrp_data(ir_graph *irg);
58 * Test, if the two nodes can be compared with their vrp information
60 * @param left: the left node
61 * @param right: the right node
62 * @return all possible relations
64 FIRM_API ir_relation vrp_cmp(const ir_node *left, const ir_node *right);
67 * Returns the vrp data for this node
68 * Note: only allowed for nodes with an integer mode!
70 * @param n: the node for which to return the vrp information
71 * @return a pointer to the vrp data or NULL if there is none
73 FIRM_API vrp_attr *vrp_get_info(const ir_node *n);