Lines Matching refs:live
36 #include "tree-ssa-live.h"
404 2) Declares no live variables
485 levels that keep an upper level with a label live, so we have to
552 /* Innermost blocks with no live variables nor statements can be always
969 /* Allocate and return a new live range information object base on MAP. */
974 tree_live_info_p live;
977 live = XNEW (struct tree_live_info_d);
978 live->map = map;
979 live->num_blocks = last_basic_block_for_fn (cfun);
981 bitmap_obstack_initialize (&live->livein_obstack);
982 bitmap_obstack_initialize (&live->liveout_obstack);
984 live->livein = XCNEWVEC (bitmap_head, last_basic_block_for_fn (cfun));
985 live->liveout = XCNEWVEC (bitmap_head, last_basic_block_for_fn (cfun));
988 bitmap_initialize (&live->livein[bb->index], &live->livein_obstack);
989 bitmap_initialize (&live->liveout[bb->index], &live->liveout_obstack);
992 live->work_stack = XNEWVEC (int, last_basic_block_for_fn (cfun));
993 live->stack_top = live->work_stack;
995 live->global = BITMAP_ALLOC (NULL);
996 return live;
1000 /* Free storage for live range info object LIVE. */
1003 delete_tree_live_info (tree_live_info_p live)
1005 if (live->livein)
1007 bitmap_obstack_release (&live->livein_obstack);
1008 free (live->livein);
1010 if (live->liveout)
1012 bitmap_obstack_release (&live->liveout_obstack);
1013 free (live->liveout);
1015 BITMAP_FREE (live->global);
1016 free (live->work_stack);
1017 free (live);
1021 /* Visit basic block BB and propagate any required live on entry bits from
1022 LIVE into the predecessors. VISITED is the bitmap of visited blocks.
1027 loe_visit_block (tree_live_info_p live, basic_block bb, sbitmap visited)
1038 loe = live_on_entry (live, bb);
1043 if (!region_contains_p (live->map, pred_bb))
1045 /* Variables live-on-entry from BB that aren't defined in the
1046 predecessor block. This should be the live on entry vars to pred.
1047 Note that liveout is the DEFs in a block while live on entry is
1049 Add these bits to live-on-entry for the pred. if there are any
1052 change = bitmap_ior_and_compl_into (live_on_entry (live, pred_bb),
1053 loe, &live->liveout[pred_bb->index]);
1058 *(live->stack_top)++ = pred_bb->index;
1064 /* Using LIVE, fill in all the live-on-entry blocks between the defs and uses
1068 live_worklist (tree_live_info_p live)
1076 /* Visit region's blocks in reverse order and propagate live on entry values
1078 for (unsigned i = live->map->vec_bbs.length () - 1;
1079 live->map->vec_bbs.iterate (i, &bb); --i)
1080 loe_visit_block (live, bb, visited);
1083 while (live->stack_top != live->work_stack)
1085 b = *--(live->stack_top);
1086 loe_visit_block (live, BASIC_BLOCK_FOR_FN (cfun, b), visited);
1091 /* Calculate the initial live on entry vector for SSA_NAME using immediate_use
1092 links. Set the live on entry fields in LIVE. Def's are marked temporarily
1096 set_var_live_on_entry (tree ssa_name, tree_live_info_p live)
1105 p = var_to_partition (live->map, ssa_name);
1114 if (def_bb && region_contains_p (live->map, def_bb))
1115 bitmap_set_bit (&live->liveout[def_bb->index], p);
1125 add it to the list of live on entry blocks. */
1133 /* Uses in PHI's are considered to be live at exit of the SRC block
1135 defined in that block, or whether its live on entry. */
1138 if (e->src != def_bb && region_contains_p (live->map, e->src))
1145 /* If its not defined in this block, its live on entry. */
1147 if (use_bb != def_bb && region_contains_p (live->map, use_bb))
1151 /* If there was a live on entry use, set the bit. */
1155 bitmap_set_bit (&live->livein[add_block->index], p);
1159 /* If SSA_NAME is live on entry to at least one block, fill in all the live
1162 bitmap_set_bit (live->global, p);
1166 /* Calculate the live on exit vectors based on the entry info in LIVEINFO. */
1175 /* live on entry calculations used liveout vectors for defs, clear them. */
1179 /* Set all the live-on-exit bits for uses in PHIs. */
1185 /* Mark the PHI arguments which are live on exit to the pred block. */
1211 /* Add each successors live on entry to this bock live on exit. */
1220 /* Given partition map MAP, calculate all the live on entry bitmaps for
1221 each partition. Return a new live info object. */
1228 tree_live_info_p live;
1230 live = new_tree_live_info (map);
1235 set_var_live_on_entry (var, live);
1238 live_worklist (live);
1241 verify_live_on_entry (live);
1243 calculate_live_on_exit (live);
1247 bitmap_obstack_release (&live->livein_obstack);
1248 free (live->livein);
1249 live->livein = NULL;
1252 return live;
1259 /* Vector of bitmaps for live vars indices at the end of basic blocks,
1263 /* Work bitmap of currently live variables. */
1285 /* Helper routine for compute_live_vars, calculating the sets of live
1324 (might be) live at the end of each basic block. */
1331 /* We approximate the live range of a stack variable by taking the first
1373 live after the STOP_AFTER statement and return that bitmap. */
1463 /* Output live range info LIVE to file F, controlled by FLAG. */
1466 dump_live_info (FILE *f, tree_live_info_p live, int flag)
1470 var_map map = live->map;
1473 if ((flag & LIVEDUMP_ENTRY) && live->livein)
1478 EXECUTE_IF_SET_IN_BITMAP (&live->livein[bb->index], 0, i, bi)
1487 if ((flag & LIVEDUMP_EXIT) && live->liveout)
1492 EXECUTE_IF_SET_IN_BITMAP (&live->liveout[bb->index], 0, i, bi)
1521 /* Verify that the info in LIVE matches the current cfg. */
1524 verify_live_on_entry (tree_live_info_p live)
1533 var_map map = live->map;
1535 /* Check for live on entry partitions and report those with a DEF in
1543 if (!region_contains_p (live->map, e->dest))
1556 loe = live_on_entry (live, e->dest);
1568 fprintf (stderr, "\nIt is also live-on-entry to entry BB %d",
1578 fprintf (stderr, " is live-on-entry to BB%d ",
1599 /* The only way this var shouldn't be marked live on entry is
1628 fprintf (stderr, " is not marked live-on-entry to entry BB%d ",