GCC Middle and Back End API Reference
|
Variables | |
static int | rgn_n_insns |
static int | sched_rgn_n_insns |
static bitmap_head | dont_calc_deps |
static basic_block | last_bb |
static struct common_sched_info_def | ebb_common_sched_info |
static struct sched_deps_info_def | ebb_sched_deps_info |
static struct haifa_sched_info | ebb_sched_info |
|
static |
The following function adds dependencies between jumps and risky insns in given ebb.
Ensure blocks stay in the same order.
Fall through.
??? We could implement better checking PRISKY_CANDIDATEs analogous to sched-rgn.c.
We can not change the mode of the backward dependency because REG_DEP_ANTI has the lowest rank.
Maintain the invariant that bb->aux is clear after use.
|
static |
|
static |
Return next block in ebb chain. For parameter meaning please refer to sched-int.h: struct sched_info: advance_target_bb.
We handle interblock movement of the speculation check or over a speculation check in haifa-sched.c: move_block_after_check ().
Assert that we don't move jumps across blocks.
Return next non empty block.
|
static |
INSN is being moved to its place in the schedule, after LAST.
INSN is a jump in the last block, ...
that is going to be moved over some instructions.
An obscure special case, where we do have partially dead instruction scheduled after last control flow instruction. In this case we can create new basic block. It is always exactly one basic block last in the sequence.
Create an empty unreachable block after the INSN.
split_edge () creates BB before E->DEST. Keep in mind, that this operation extends scheduling region till the end of BB. Hence, we need to shift NEXT_TAIL, so haifa-sched.c won't go out of the scheduling region.
Append new basic block to the end of the ebb.
|
static |
|
static |
INSN is being scheduled after LAST. Update counters.
|
static |
Print dependency information about ebb between HEAD and TAIL.
References current_sched_info, haifa_sched_info::next_tail, haifa_sched_info::prev_head, sched_rgn_n_insns, and sched_verbose.
|
static |
|
static |
Returns the earliest block in EBB currently being processed where a "similar load" 'insn2' is found, and hence LOAD_INSN can move speculatively into the found block. All the following must hold: (1) both loads have 1 base register (PFREE_CANDIDATEs). (2) load_insn and load2 have a def-use dependence upon the same insn 'insn1'. From all these we can conclude that the two loads access memory addresses that differ at most by a constant, and hence if moving load_insn would cause an exception, it would have been caused by load2 anyhow. The function uses list (given by LAST_BLOCK) of already processed blocks in EBB. The list is formed in `add_deps_for_risky_insns'.
Found a DEF-USE dependence (insn1, load_insn).
Found a DEF-USE dependence (insn1, insn2).
insn2 not guaranteed to be a 1 base reg load.
insn2 is the similar load.
|
static |
|
static |
BB was added to ebb after AFTER.
Recovery blocks are always bounded by BARRIERS, therefore, they always form single block EBB, therefore, we can use rec->index to identify such EBBs.
|
static |
|
static |
INSN has been added to/removed from current ebb.
References basic_block_def::index.
void ebb_compute_jump_reg_dependencies | ( | ) |
INSN is a JUMP_INSN. Store the set of registers that must be considered as used by this jump in USED.
Referenced by ebb_contributes_to_priority().
NEXT is an instruction that depends on INSN (a backward dependence); return nonzero if we should include this dependence in priority calculations.
References ebb_compute_jump_reg_dependencies().
|
static |
Fix internal data after interblock movement of jump instruction. For parameter meaning please refer to sched-int.h: struct sched_info: fix_recovery_cfg.
|
static |
|
static |
Return a string that contains the insn uid and optionally anything else necessary to identify this insn in an output. It's valid to use a static buffer for this. The ALIGNED parameter should cause the string to be formatted so that multiple output lines will line up nicely.
'+' before insn means it is a new cycle start.
|
static |
Implementations of the sched_info functions for region scheduling.
Add all insns that are initially ready to the ready list READY. Called once before scheduling a set of insns.
Print debugging information.
Initialize ready list with all 'ready' insns in target block. Count number of insns in the target block being scheduled.
Referenced by get_rank().
|
static |
Compare priority of two insns. Return a positive number if the second insn is to be preferred for scheduling, and a negative one if the first is to be preferred. Zero if they are equally good.
References bitmap_ior_into(), edge_def::dest, df_get_live_in(), edge_def::flags, and basic_block_def::succs.
|
static |
Restore the state of the frontend from P_, then free it.
References rgn_n_insns, and sched_rgn_n_insns.
|
static |
Allocate memory and store the state of the frontend. Return the allocated memory.
References free(), and sched_rgn_n_insns.
basic_block schedule_ebb | ( | ) |
Schedule a single extended basic block, defined by the boundaries HEAD and TAIL. We change our expectations about scheduler behaviour depending on whether MODULO_SCHEDULING is true. If it is, we expect that the caller has already called set_modulo_params and created delay pairs as appropriate. If the modulo schedule failed, we return NULL_RTX.
Blah. We should fix the rest of the code not to get confused by a note or two.
Compute dependencies.
Only recovery blocks can have their dependencies already calculated, and they always are single block ebbs.
Set priorities.
Make ready list big enough to hold all the instructions from the ebb.
Free ready list.
We might pack all instructions into fewer blocks, so we may made some of them empty. Can't assert (b == last_bb).
Sanity check: verify that all region insns were scheduled.
Free dependencies.
LAST_BB is unreachable.
References targetm.
void schedule_ebbs | ( | void | ) |
The main entry point in this file.
Taking care of this degenerate case makes the rest of this code simpler.
Schedule every region in the subroutine.
void schedule_ebbs_finish | ( | void | ) |
Perform cleanups after scheduling using schedules_ebbs or schedule_ebb.
Reposition the prologue and epilogue notes in case we moved the prologue/epilogue insns.
void schedule_ebbs_init | ( | void | ) |
Perform initializations before running schedule_ebbs or a single schedule_ebb.
Setup infos.
Initialize DONT_CALC_DEPS and ebb-{start, end} markers.
|
static |
Return nonzero if there are more insns that should be scheduled.
|
static |
Set of blocks, that already have their dependencies calculated.
|
static |
Used in schedule_insns to initialize current_sched_info for scheduling regions (or single basic blocks).
|
static |
|
static |
|
static |
Last basic block in current ebb.
Referenced by thread_prologue_and_epilogue_insns().
|
static |
@verbatim
Instruction scheduling pass. Copyright (C) 1992-2013 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiema) Enhanced by, and currently maintained by, Jim Wilson ( nn@c ygnus .comwilso) n@cy gnus. com
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.
The number of insns to be scheduled in total.
Referenced by restore_ebb_state().
|
static |
The number of insns scheduled so far.
Referenced by debug_ebb_dependencies(), restore_ebb_state(), and save_ebb_state().