summaryrefslogtreecommitdiff
path: root/gcc/bb-reorder.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2010-07-12 19:04:11 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2010-07-12 19:04:11 +0000
commit76ee381a9c92e5ef9448ff24aa6c82703c2561c8 (patch)
tree2c1af71f54de34d009cdd25542919f79c669973b /gcc/bb-reorder.c
parent7c6811fe1e7b07f9ab3ea30d76e615b33ae6a783 (diff)
downloadgcc-76ee381a9c92e5ef9448ff24aa6c82703c2561c8.tar.gz
Makefile.in (bb-reorder.o, [...]): Depend on bb-reorder.h
gcc/ * Makefile.in (bb-reorder.o, target-globals.o): Depend on bb-reorder.h * bb-reorder.h: New file. * bb-reorder.c (default_target_bb_reorder): New variable. (this_target_bb_reorder): New conditional variable. (uncond_jump_length): Redefine as a macro. * target-globals.h (this_target_bb_reorder): Declare. (target_globals): Add a bb_reorder field. (restore_target_globals): Copy the bb_reorder field to this_target_bb-reorder. * target-globals.c: Include bb-reorder.h. (default_target_globals): Initialize the bb_reorder field. (save_target_globals): Likewise. From-SVN: r162109
Diffstat (limited to 'gcc/bb-reorder.c')
-rw-r--r--gcc/bb-reorder.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index cf282d222a6..2bf0b853165 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -86,6 +86,7 @@
#include "toplev.h" /* user_defined_section_attribute */
#include "tree-pass.h"
#include "df.h"
+#include "bb-reorder.h"
/* The number of rounds. In most cases there will only be 4 rounds, but
when partitioning hot and cold basic blocks into separate sections of
@@ -101,6 +102,14 @@
#endif
+struct target_bb_reorder default_target_bb_reorder;
+#if SWITCHABLE_TARGET
+struct target_bb_reorder *this_target_bb_reorder = &default_target_bb_reorder;
+#endif
+
+#define uncond_jump_length \
+ (this_target_bb_reorder->x_uncond_jump_length)
+
/* Branch thresholds in thousandths (per mille) of the REG_BR_PROB_BASE. */
static int branch_threshold[N_ROUNDS] = {400, 200, 100, 0, 0};
@@ -111,9 +120,6 @@ static int exec_threshold[N_ROUNDS] = {500, 200, 50, 0, 0};
block the edge destination is not duplicated while connecting traces. */
#define DUPLICATION_THRESHOLD 100
-/* Length of unconditional jump instruction. */
-static int uncond_jump_length;
-
/* Structure to hold needed information for each basic block. */
typedef struct bbro_basic_block_data_def
{