aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2001-01-15 22:45:32 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2001-01-15 22:45:32 +0000
commit3ff51205709ba6abfcd537ac635b4c0085c51db7 (patch)
tree23385eb6895de7d47672c7ceb1816b55800119ee /gcc
parent3cf96b52a1ff56ba9fe091fb3d19e4e86aa8c27c (diff)
downloadgcc-3ff51205709ba6abfcd537ac635b4c0085c51db7.zip
gcc-3ff51205709ba6abfcd537ac635b4c0085c51db7.tar.gz
gcc-3ff51205709ba6abfcd537ac635b4c0085c51db7.tar.bz2
new option to disable guessing of branch prediction
From-SVN: r39052
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/flags.h3
-rw-r--r--gcc/toplev.c9
3 files changed, 21 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7e99053..1c3f698 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2001-01-12 Aldy Hernandez <aldyh@redhat.com>
+
+ * toplev.c (flag_guess_branch_prob): New.
+ (f_options): Add guess-branch-probability option.
+ (rest_of_decl_compilation): Only estimate branch probability if
+ flag set.
+ (main): set flag_guess_branch_prob.
+
+ * flags.h (flag_guess_branch_prob): New.
+
2001-01-15 DJ Delorie <dj@redhat.com>
* gcc.texi (Makefile): Add documentation for Makefile targets.
diff --git a/gcc/flags.h b/gcc/flags.h
index fc19efe..99678ba 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -531,6 +531,9 @@ extern int flag_instrument_function_entry_exit;
/* Perform a peephole pass before sched2. */
extern int flag_peephole2;
+/* Try to guess branch probablities. */
+extern int flag_guess_branch_prob;
+
/* -fbounded-pointers causes gcc to compile pointers as composite
objects occupying three words: the pointer value, the base address
of the referent object, and the address immediately beyond the end
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 408f04a..5134361 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -868,6 +868,9 @@ int flag_no_ident = 0;
/* This will perform a peephole pass before sched2. */
int flag_peephole2 = 0;
+/* This will try to guess branch probabilities. */
+int flag_guess_branch_prob = 0;
+
/* -fbounded-pointers causes gcc to compile pointers as composite
objects occupying three words: the pointer value, the base address
of the referent object, and the address immediately beyond the end
@@ -1136,6 +1139,8 @@ lang_independent_options f_options[] =
"Process #ident directives"},
{ "peephole2", &flag_peephole2, 1,
"Enables an rtl peephole pass run before sched2" },
+ { "guess-branch-probability", &flag_guess_branch_prob, 1,
+ "Enables guessing of branch probabilities" },
{"math-errno", &flag_errno_math, 1,
"Set errno after built-in math functions"},
{"bounded-pointers", &flag_bounded_pointers, 1,
@@ -3253,7 +3258,8 @@ rest_of_compilation (decl)
flow_loops_find (&loops, LOOP_TREE);
/* Estimate using heuristics if no profiling info is available. */
- estimate_probability (&loops);
+ if (flag_guess_branch_prob)
+ estimate_probability (&loops);
if (rtl_dump_file)
flow_loops_dump (&loops, rtl_dump_file, NULL, 0);
@@ -4636,6 +4642,7 @@ main (argc, argv)
#ifdef CAN_DEBUG_WITHOUT_FP
flag_omit_frame_pointer = 1;
#endif
+ flag_guess_branch_prob = 1;
}
if (optimize >= 2)