Commit bdf3202e authored by Andreas Zwinkau's avatar Andreas Zwinkau
Browse files

Refactor: better name for former 'fp-vrp' analysis

parent 9a202f69
......@@ -28,7 +28,7 @@
#include "tv.h"
#include "irpass.h"
#include "irmemory.h"
#include "fp-vrp.h"
#include "constbits.h"
/* TODO:
* - Implement cleared/set bit calculation for Add, Sub, Minus, Mul, Div, Mod, Shl, Shr, Shrs, Rotl
......@@ -109,8 +109,6 @@ DEBUG_ONLY(static firm_dbg_module_t *dbg;)
static struct obstack *obst;
typedef struct vrp_bitinfo bitinfo;
static bool is_undefined(bitinfo const* const b)
{
return tarval_is_null(b->z) && tarval_is_all_one(b->o);
......@@ -646,7 +644,7 @@ static void build_phi_lists(ir_node *irn, void *env)
add_Block_phi(get_nodes_block(irn), irn);
}
void fp_vrp_analyze(ir_graph* const irg, struct obstack *client_obst)
void constbits_analyze(ir_graph* const irg, struct obstack *client_obst)
{
obst = client_obst;
......
#ifndef FP_VRP_H
#define FP_VRP_H
#ifndef CONSTBITS_H
#define CONSTBITS_H
#include "adt/obst.h"
typedef struct vrp_bitinfo
typedef struct bitinfo
{
ir_tarval* z; /* safe zeroes, 0 = bit is zero, 1 = bit maybe is 1 */
ir_tarval* o; /* safe ones, 0 = bit maybe is zero, 1 = bit is 1 */
} vrp_bitinfo;
} bitinfo;
/* Get VRP analysis information for node irn */
vrp_bitinfo* get_bitinfo(ir_node const* const irn);
/* Get analysis information for node irn */
bitinfo* get_bitinfo(ir_node const* const irn);
/* Set VRP analysis information for node irn */
/* Set analysis information for node irn */
int set_bitinfo(ir_node* const irn, ir_tarval* const z, ir_tarval* const o);
/* Compute VRP fixpoint. The Result is available via links to
* vrp_bitinfo*, allocated on client_obst. */
void fp_vrp_analyze(ir_graph* const irg, struct obstack *client_obst);
/* Compute value range fixpoint aka which bits of value are constant zero/one.
* The result is available via links to bitinfo*, allocated on client_obst. */
void constbits_analyze(ir_graph* const irg, struct obstack *client_obst);
#endif
......@@ -28,7 +28,7 @@
#include "tv.h"
#include "irpass.h"
#include "irmemory.h"
#include "fp-vrp.h"
#include "constbits.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg;)
......@@ -36,8 +36,6 @@ typedef struct environment_t {
unsigned modified:1; /**< Set, if the graph was modified. */
} environment_t;
typedef struct vrp_bitinfo bitinfo;
static int mode_is_intb(ir_mode const* const m)
{
return mode_is_int(m) || m == mode_b;
......@@ -221,7 +219,7 @@ void fixpoint_vrp(ir_graph* const irg)
ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK | IR_RESOURCE_PHI_LIST);
fp_vrp_analyze(irg, &private_obst);
constbits_analyze(irg, &private_obst);
FIRM_DBG_REGISTER(dbg, "firm.opt.fp-vrp");
DB((dbg, LEVEL_1, "===> Performing constant propagation on %+F (optimization)\n", irg));
......
......@@ -28,7 +28,7 @@
#include "tv.h"
#include "irnodemap.h"
#include "dca.h"
#include "fp-vrp.h"
#include "constbits.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg;)
......@@ -48,7 +48,7 @@ static void occult_const_opt_walker(ir_node *node, void *data)
if (!mode_is_data(get_irn_mode(node))) return;
env_t *env = (env_t *)data;
vrp_bitinfo *vrp = ir_nodemap_get(vrp_bitinfo, &env->vrp, node);
bitinfo *vrp = ir_nodemap_get(bitinfo, &env->vrp, node);
if (vrp == NULL) {
DB((dbg, LEVEL_4, "No VRP info: %+F\n", node));
......@@ -91,7 +91,7 @@ void occult_consts(ir_graph *irg)
ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK | IR_RESOURCE_PHI_LIST);
fp_vrp_analyze(irg, &env.obst);
constbits_analyze(irg, &env.obst);
ir_nodemap_init(&env.vrp, irg);
irg_walk_graph(irg, fill_nodemap, 0, &env.vrp);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment