+static void *vrp_init_node(ir_phase *phase, const ir_node *n, void *old)
+{
+ ir_mode *mode;
+ vrp_attr *vrp;
+ struct vrp_env_t *env = phase->priv;
+
+ DBG((env->dbg, LEVEL_2, "initialized node nr: %d\n", get_irn_node_nr(n)));
+ assert(old==NULL && "init called for node already initialized");
+ vrp = phase_alloc(phase, sizeof(vrp_attr));
+
+ memset(vrp, 0, sizeof(vrp_attr));
+ /* Initialize the vrp information to default */
+
+ mode = get_irn_mode(n);
+
+ vrp->range_type = VRP_UNDEFINED;
+
+ /* TODO: We might be able to optimize space usage if we do not allocate
+ * vrp space for non-int nodes. (currently caught by vrp_update_node)
+ */
+ if (mode_is_int(mode)) {
+ /* We are assuming that 0 is always represented as this modes null */
+ vrp->valid = 1;
+ vrp->bits_set = get_mode_null(mode);
+ vrp->bits_not_set = get_mode_all_one(mode);
+ vrp->range_bottom = get_tarval_top();
+ vrp->range_top = get_tarval_top();
+ } else {
+ vrp->valid = 0;
+ vrp->bits_set = get_tarval_bad();
+ vrp->bits_not_set = get_tarval_bad();
+ vrp->range_bottom = get_tarval_bad();
+ vrp->range_top = get_tarval_bad();
+ }
+
+ /* TODO: We might be able to set better vrp info at this time, if this is
+ * a node which is newly created in an already initialized irg
+ *
+ * maybe just call vrp_update_node and if it returns one, iterate over
+ * successors
+ */
+ return vrp;
+}