Lines Matching refs:blocks
29 zend_basic_block *blocks = cfg->blocks; in zend_mark_reachable() local
41 zend_basic_block *succ = blocks + b->successors[i]; in zend_mark_reachable()
108 zend_basic_block *blocks = cfg->blocks; in zend_mark_reachable_blocks() local
110 blocks[start].flags = ZEND_BB_START; in zend_mark_reachable_blocks()
111 zend_mark_reachable(op_array->opcodes, cfg, blocks + start); in zend_mark_reachable_blocks()
128 b = blocks + block_map[live_range->start]; in zend_mark_reachable_blocks()
149 b = blocks + block_map[live_range->end]; in zend_mark_reachable_blocks()
160 ZEND_ASSERT(!(blocks[block_map[live_range->end]].flags & ZEND_BB_REACHABLE)); in zend_mark_reachable_blocks()
168 b = blocks + block_map[op_array->try_catch_array[j].try_op]; in zend_mark_reachable_blocks()
173 end = blocks + block_map[op_array->try_catch_array[j].catch_op]; in zend_mark_reachable_blocks()
182 b = blocks + block_map[op_array->try_catch_array[j].try_op]; in zend_mark_reachable_blocks()
185 end = blocks + block_map[op_array->try_catch_array[j].finally_op]; in zend_mark_reachable_blocks()
190 …zend_mark_reachable(op_array->opcodes, cfg, blocks + block_map[op_array->try_catch_array[j].try_op… in zend_mark_reachable_blocks()
199 b = blocks + block_map[op_array->try_catch_array[j].try_op]; in zend_mark_reachable_blocks()
203 b = blocks + block_map[op_array->try_catch_array[j].catch_op]; in zend_mark_reachable_blocks()
211 b = blocks + block_map[op_array->try_catch_array[j].finally_op]; in zend_mark_reachable_blocks()
219 b = blocks + block_map[op_array->try_catch_array[j].finally_end]; in zend_mark_reachable_blocks()
228 …ZEND_ASSERT(!(blocks[block_map[op_array->try_catch_array[j].catch_op]].flags & ZEND_BB_REACHABLE)); in zend_mark_reachable_blocks()
231 …ZEND_ASSERT(!(blocks[block_map[op_array->try_catch_array[j].finally_op]].flags & ZEND_BB_REACHABLE… in zend_mark_reachable_blocks()
234 …ZEND_ASSERT(!(blocks[block_map[op_array->try_catch_array[j].finally_end]].flags & ZEND_BB_REACHABL… in zend_mark_reachable_blocks()
245 zend_basic_block *blocks = cfg->blocks; in zend_cfg_remark_reachable_blocks() local
250 if (blocks[i].flags & ZEND_BB_REACHABLE) { in zend_cfg_remark_reachable_blocks()
259 blocks[i].flags = 0; in zend_cfg_remark_reachable_blocks()
292 zend_basic_block *blocks; in zend_build_cfg() local
482 cfg->blocks = blocks = zend_arena_calloc(arena, sizeof(zend_basic_block), blocks_count); in zend_build_cfg()
487 initialize_block(&blocks[0]); in zend_build_cfg()
488 blocks[0].start = 0; in zend_build_cfg()
489 blocks[0].len = 0; in zend_build_cfg()
496 blocks[blocks_count].len = i - blocks[blocks_count].start; in zend_build_cfg()
499 initialize_block(&blocks[blocks_count]); in zend_build_cfg()
500 blocks[blocks_count].start = i; in zend_build_cfg()
505 blocks[blocks_count].len = i - blocks[blocks_count].start; in zend_build_cfg()
510 zend_basic_block *block = &blocks[j]; in zend_build_cfg()
614 zend_basic_block *blocks = cfg->blocks; in zend_cfg_build_predecessors() local
615 zend_basic_block *end = blocks + cfg->blocks_count; in zend_cfg_build_predecessors()
619 for (b = blocks; b < end; b++) { in zend_cfg_build_predecessors()
622 for (b = blocks; b < end; b++) { in zend_cfg_build_predecessors()
629 blocks[b->successors[s]].predecessors_count++; in zend_cfg_build_predecessors()
638 for (b = blocks; b < end; b++) { in zend_cfg_build_predecessors()
647 if (blocks[j].flags & ZEND_BB_REACHABLE) { in zend_cfg_build_predecessors()
649 for (s = 0; s < blocks[j].successors_count; s++) { in zend_cfg_build_predecessors()
654 if (blocks[j].successors[p] == blocks[j].successors[s]) { in zend_cfg_build_predecessors()
660 zend_basic_block *b = blocks + blocks[j].successors[s]; in zend_cfg_build_predecessors()
678 zend_basic_block *block = &cfg->blocks[block_num]; in compute_postnum_recursive()
695 zend_basic_block *blocks = cfg->blocks; in zend_cfg_compute_dominators_tree() local
706 blocks[0].idom = 0; in zend_cfg_compute_dominators_tree()
713 if ((blocks[j].flags & ZEND_BB_REACHABLE) == 0) { in zend_cfg_compute_dominators_tree()
716 for (k = 0; k < blocks[j].predecessors_count; k++) { in zend_cfg_compute_dominators_tree()
717 int pred = cfg->predecessors[blocks[j].predecessor_offset + k]; in zend_cfg_compute_dominators_tree()
720 if (blocks[pred].idom >= 0) in zend_cfg_compute_dominators_tree()
725 if (blocks[pred].idom >= 0) { in zend_cfg_compute_dominators_tree()
727 while (postnum[pred] < postnum[idom]) pred = blocks[pred].idom; in zend_cfg_compute_dominators_tree()
728 while (postnum[idom] < postnum[pred]) idom = blocks[idom].idom; in zend_cfg_compute_dominators_tree()
733 if (idom >= 0 && blocks[j].idom != idom) { in zend_cfg_compute_dominators_tree()
734 blocks[j].idom = idom; in zend_cfg_compute_dominators_tree()
739 blocks[0].idom = -1; in zend_cfg_compute_dominators_tree()
742 if ((blocks[j].flags & ZEND_BB_REACHABLE) == 0) { in zend_cfg_compute_dominators_tree()
745 if (blocks[j].idom >= 0) { in zend_cfg_compute_dominators_tree()
747 if (blocks[blocks[j].idom].children < 0 || in zend_cfg_compute_dominators_tree()
748 j < blocks[blocks[j].idom].children) { in zend_cfg_compute_dominators_tree()
749 blocks[j].next_child = blocks[blocks[j].idom].children; in zend_cfg_compute_dominators_tree()
750 blocks[blocks[j].idom].children = j; in zend_cfg_compute_dominators_tree()
752 int k = blocks[blocks[j].idom].children; in zend_cfg_compute_dominators_tree()
753 while (blocks[k].next_child >=0 && j > blocks[k].next_child) { in zend_cfg_compute_dominators_tree()
754 k = blocks[k].next_child; in zend_cfg_compute_dominators_tree()
756 blocks[j].next_child = blocks[k].next_child; in zend_cfg_compute_dominators_tree()
757 blocks[k].next_child = j; in zend_cfg_compute_dominators_tree()
763 int idom = blocks[j].idom, level = 0; in zend_cfg_compute_dominators_tree()
764 if ((blocks[j].flags & ZEND_BB_REACHABLE) == 0) { in zend_cfg_compute_dominators_tree()
769 if (blocks[idom].level >= 0) { in zend_cfg_compute_dominators_tree()
770 level += blocks[idom].level; in zend_cfg_compute_dominators_tree()
773 idom = blocks[idom].idom; in zend_cfg_compute_dominators_tree()
776 blocks[j].level = level; in zend_cfg_compute_dominators_tree()
784 static int dominates(zend_basic_block *blocks, int a, int b) /* {{{ */ in dominates() argument
786 while (blocks[b].level > blocks[a].level) { in dominates()
787 b = blocks[b].idom; in dominates()
810 zend_basic_block *blocks = cfg->blocks; in zend_cfg_identify_loops() local
836 for (j = blocks[i].children; j >= 0; j = blocks[j].next_child) { in zend_cfg_identify_loops()
842 for (j = 0; j < blocks[i].successors_count; j++) { in zend_cfg_identify_loops()
843 int succ = blocks[i].successors[j]; in zend_cfg_identify_loops()
844 if (blocks[succ].idom == i) { in zend_cfg_identify_loops()
858 sorted_blocks[i].level = blocks[i].level; in zend_cfg_identify_loops()
870 for (j = 0; j < blocks[i].predecessors_count; j++) { in zend_cfg_identify_loops()
871 int pred = cfg->predecessors[blocks[i].predecessor_offset + j]; in zend_cfg_identify_loops()
875 if (blocks[i].idom == pred) { in zend_cfg_identify_loops()
881 if (dominates(blocks, i, pred)) { in zend_cfg_identify_loops()
882 blocks[i].flags |= ZEND_BB_LOOP_HEADER; in zend_cfg_identify_loops()
889 blocks[i].flags |= ZEND_BB_IRREDUCIBLE_LOOP; in zend_cfg_identify_loops()
897 while (blocks[j].loop_header >= 0) { in zend_cfg_identify_loops()
898 j = blocks[j].loop_header; in zend_cfg_identify_loops()
901 blocks[j].loop_header = i; in zend_cfg_identify_loops()
902 for (k = 0; k < blocks[j].predecessors_count; k++) { in zend_cfg_identify_loops()
903 zend_worklist_push(&work, cfg->predecessors[blocks[j].predecessor_offset + k]); in zend_cfg_identify_loops()