summaryrefslogtreecommitdiff
path: root/gcc/bb-reorder.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-12 19:04:11 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-12 19:04:11 +0000
commit22d65d2c5f380476cb0375bfb086d95c4f10b7fb (patch)
tree2c1af71f54de34d009cdd25542919f79c669973b /gcc/bb-reorder.c
parent049d15fc2288f843235d5cae6bc4b30d95ec51ae (diff)
downloadgcc-22d65d2c5f380476cb0375bfb086d95c4f10b7fb.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162109 138bc75d-0d04-0410-961f-82ee72b054a4
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
{