diff options
Diffstat (limited to 'gcc/ipa-split.c')
-rw-r--r-- | gcc/ipa-split.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c index 59d174220c3..d7d6b8fd70f 100644 --- a/gcc/ipa-split.c +++ b/gcc/ipa-split.c @@ -210,7 +210,7 @@ verify_non_ssa_vars (struct split_point *current, bitmap non_ssa_vars, bool ok = true; FOR_EACH_EDGE (e, ei, current->entry_bb->preds) - if (e->src != ENTRY_BLOCK_PTR + if (e->src != ENTRY_BLOCK_PTR_FOR_FN (cfun) && !bitmap_bit_p (current->split_bbs, e->src->index)) { worklist.safe_push (e->src); @@ -223,7 +223,7 @@ verify_non_ssa_vars (struct split_point *current, bitmap non_ssa_vars, basic_block bb = worklist.pop (); FOR_EACH_EDGE (e, ei, bb->preds) - if (e->src != ENTRY_BLOCK_PTR + if (e->src != ENTRY_BLOCK_PTR_FOR_FN (cfun) && bitmap_set_bit (seen, e->src->index)) { gcc_checking_assert (!bitmap_bit_p (current->split_bbs, @@ -396,7 +396,7 @@ consider_split (struct split_point *current, bitmap non_ssa_vars, /* Do not split when we would end up calling function anyway. */ if (incoming_freq - >= (ENTRY_BLOCK_PTR->frequency + >= (ENTRY_BLOCK_PTR_FOR_FN (cfun)->frequency * PARAM_VALUE (PARAM_PARTIAL_INLINING_ENTRY_PROBABILITY) / 100)) { /* When profile is guessed, we can not expect it to give us @@ -406,13 +406,13 @@ consider_split (struct split_point *current, bitmap non_ssa_vars, is likely noticeable win. */ if (back_edge && profile_status != PROFILE_READ - && incoming_freq < ENTRY_BLOCK_PTR->frequency) + && incoming_freq < ENTRY_BLOCK_PTR_FOR_FN (cfun)->frequency) { if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, " Split before loop, accepting despite low frequencies %i %i.\n", incoming_freq, - ENTRY_BLOCK_PTR->frequency); + ENTRY_BLOCK_PTR_FOR_FN (cfun)->frequency); } else { @@ -583,7 +583,7 @@ consider_split (struct split_point *current, bitmap non_ssa_vars, /* split_function fixes up at most one PHI non-virtual PHI node in return_bb, for the return value. If there are other PHIs, give up. */ - if (return_bb != EXIT_BLOCK_PTR) + if (return_bb != EXIT_BLOCK_PTR_FOR_FN (cfun)) { gimple_stmt_iterator psi; @@ -650,15 +650,15 @@ static basic_block find_return_bb (void) { edge e; - basic_block return_bb = EXIT_BLOCK_PTR; + basic_block return_bb = EXIT_BLOCK_PTR_FOR_FN (cfun); gimple_stmt_iterator bsi; bool found_return = false; tree retval = NULL_TREE; - if (!single_pred_p (EXIT_BLOCK_PTR)) + if (!single_pred_p (EXIT_BLOCK_PTR_FOR_FN (cfun))) return return_bb; - e = single_pred_edge (EXIT_BLOCK_PTR); + e = single_pred_edge (EXIT_BLOCK_PTR_FOR_FN (cfun)); for (bsi = gsi_last_bb (e->src); !gsi_end_p (bsi); gsi_prev (&bsi)) { gimple stmt = gsi_stmt (bsi); @@ -937,7 +937,7 @@ find_split_points (int overall_time, int overall_size) current.split_size = 0; current.ssa_names_to_pass = BITMAP_ALLOC (NULL); - first.bb = ENTRY_BLOCK_PTR; + first.bb = ENTRY_BLOCK_PTR_FOR_FN (cfun); first.edge_num = 0; first.overall_time = 0; first.overall_size = 0; @@ -946,7 +946,7 @@ find_split_points (int overall_time, int overall_size) first.used_ssa_names = 0; first.bbs_visited = 0; stack.safe_push (first); - ENTRY_BLOCK_PTR->aux = (void *)(intptr_t)-1; + ENTRY_BLOCK_PTR_FOR_FN (cfun)->aux = (void *)(intptr_t)-1; while (!stack.is_empty ()) { @@ -957,7 +957,7 @@ find_split_points (int overall_time, int overall_size) articulation, we want to have processed everything reachable from articulation but nothing that reaches into it. */ if (entry->edge_num == EDGE_COUNT (entry->bb->succs) - && entry->bb != ENTRY_BLOCK_PTR) + && entry->bb != ENTRY_BLOCK_PTR_FOR_FN (cfun)) { int pos = stack.length (); entry->can_split &= visit_bb (entry->bb, return_bb, @@ -1009,7 +1009,7 @@ find_split_points (int overall_time, int overall_size) entry->edge_num++; /* New BB to visit, push it to the stack. */ - if (dest != return_bb && dest != EXIT_BLOCK_PTR + if (dest != return_bb && dest != EXIT_BLOCK_PTR_FOR_FN (cfun) && !dest->aux) { stack_entry new_entry; @@ -1037,7 +1037,7 @@ find_split_points (int overall_time, int overall_size) } /* We are done with examining the edges. Pop off the value from stack and merge stuff we accumulate during the walk. */ - else if (entry->bb != ENTRY_BLOCK_PTR) + else if (entry->bb != ENTRY_BLOCK_PTR_FOR_FN (cfun)) { stack_entry *prev = &stack[stack.length () - 2]; @@ -1063,7 +1063,7 @@ find_split_points (int overall_time, int overall_size) else stack.pop (); } - ENTRY_BLOCK_PTR->aux = NULL; + ENTRY_BLOCK_PTR_FOR_FN (cfun)->aux = NULL; FOR_EACH_BB (bb) bb->aux = NULL; stack.release (); @@ -1139,7 +1139,7 @@ split_function (struct split_point *split_point) if (!split_part_return_p) ; /* We have no return block, so nothing is needed. */ - else if (return_bb == EXIT_BLOCK_PTR) + else if (return_bb == EXIT_BLOCK_PTR_FOR_FN (cfun)) ; /* When we do not want to return value, we need to construct new return block with empty return statement. @@ -1166,7 +1166,7 @@ split_function (struct split_point *split_point) break; } } - e = make_edge (new_return_bb, EXIT_BLOCK_PTR, 0); + e = make_edge (new_return_bb, EXIT_BLOCK_PTR_FOR_FN (cfun), 0); e->probability = REG_BR_PROB_BASE; e->count = new_return_bb->count; if (current_loops) @@ -1183,7 +1183,7 @@ split_function (struct split_point *split_point) Note this can happen whether or not we have a return value. If we have a return value, then RETURN_BB may have PHIs for real operands too. */ - if (return_bb != EXIT_BLOCK_PTR) + if (return_bb != EXIT_BLOCK_PTR_FOR_FN (cfun)) { bool phi_p = false; for (gsi = gsi_start_phis (return_bb); !gsi_end_p (gsi);) @@ -1325,7 +1325,7 @@ split_function (struct split_point *split_point) push_cfun (DECL_STRUCT_FUNCTION (node->decl)); var = BLOCK_VARS (DECL_INITIAL (node->decl)); i = vec_safe_length (*debug_args); - cgsi = gsi_after_labels (single_succ (ENTRY_BLOCK_PTR)); + cgsi = gsi_after_labels (single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun))); do { i -= 2; @@ -1366,13 +1366,14 @@ split_function (struct split_point *split_point) else { e = make_edge (call_bb, return_bb, - return_bb == EXIT_BLOCK_PTR ? 0 : EDGE_FALLTHRU); + return_bb == EXIT_BLOCK_PTR_FOR_FN (cfun) + ? 0 : EDGE_FALLTHRU); e->count = call_bb->count; e->probability = REG_BR_PROB_BASE; /* If there is return basic block, see what value we need to store return value into and put call just before it. */ - if (return_bb != EXIT_BLOCK_PTR) + if (return_bb != EXIT_BLOCK_PTR_FOR_FN (cfun)) { real_retval = retval = find_retval (return_bb); |