summaryrefslogtreecommitdiff
path: root/gcc/print-rtl.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>2000-04-17 09:49:00 -0700
committerRichard Henderson <rth@gcc.gnu.org>2000-04-17 09:49:00 -0700
commit994a57cd287e37aaaf909fc1ae671e54b1b360c4 (patch)
tree463f2ea9fd7c3ba92418e1563975dde99f0150de /gcc/print-rtl.c
parent2be5e524b0ce96881e40a84d0355f40edd82e07e (diff)
downloadgcc-994a57cd287e37aaaf909fc1ae671e54b1b360c4.tar.gz
builtins.c (expand_builtin_expect): New.
* builtins.c (expand_builtin_expect): New. (expand_builtin): Call it. * builtins.def (BUILT_IN_EXPECT): New. * c-common.c (c_common_nodes_and_builtins): Declare __builtin_expect. * extend.texi: Document it. * predict.c (expected_value_to_br_prob): New. (find_expected_value): New. * basic-block.h (expected_value_to_br_prob): Declare. * toplev.c (rest_of_compilation): Invoke it. * rtl.h (NOTE_EXPECTED_VALUE): New. (NOTE_INSN_EXPECTED_VALUE): New. * rtl.c (note_insn_name): Update. * print-rtl.c (print_rtx): Reorg NOTE_LINE_NUMBER special cases; handle NOTE_INSN_EXPECTED_VALUE. From-SVN: r33211
Diffstat (limited to 'gcc/print-rtl.c')
-rw-r--r--gcc/print-rtl.c76
1 files changed, 46 insertions, 30 deletions
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index ee7e64cebb5..8b7bebeb6f6 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -162,18 +162,19 @@ print_rtx (in_rtx)
case '0':
if (i == 3 && GET_CODE (in_rtx) == NOTE)
{
- if (NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_EH_REGION_BEG
- || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_EH_REGION_END)
+ switch (NOTE_LINE_NUMBER (in_rtx))
{
+ case NOTE_INSN_EH_REGION_BEG:
+ case NOTE_INSN_EH_REGION_END:
if (flag_dump_unnumbered)
fprintf (outfile, " #");
else
fprintf (outfile, " %d", NOTE_EH_HANDLER (in_rtx));
sawclose = 1;
- }
- else if (NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_BLOCK_BEG
- || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_BLOCK_END)
- {
+ break;
+
+ case NOTE_INSN_BLOCK_BEG:
+ case NOTE_INSN_BLOCK_END:
fprintf (outfile, " ");
if (flag_dump_unnumbered)
fprintf (outfile, "#");
@@ -181,36 +182,51 @@ print_rtx (in_rtx)
fprintf (outfile, HOST_PTR_PRINTF,
(char *) NOTE_BLOCK (in_rtx));
sawclose = 1;
- }
- else if (NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_RANGE_START
- || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_RANGE_END
- || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_LIVE)
- {
+ break;
+
+ case NOTE_INSN_RANGE_START:
+ case NOTE_INSN_RANGE_END:
+ case NOTE_INSN_LIVE:
indent += 2;
if (!sawclose)
fprintf (outfile, " ");
print_rtx (NOTE_RANGE_INFO (in_rtx));
indent -= 2;
- }
- else if (NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_BASIC_BLOCK)
- {
- basic_block bb = NOTE_BASIC_BLOCK (in_rtx);
+ break;
- if (bb != 0)
- fprintf (outfile, " [bb %d]", bb->index);
- }
- else
- {
- const char * const str = X0STR (in_rtx, i);
- if (str == 0)
- fputs (dump_for_graph ? " \\\"\\\"" : " \"\"", outfile);
- else
- {
- if (dump_for_graph)
- fprintf (outfile, " (\\\"%s\\\")", str);
- else
- fprintf (outfile, " (\"%s\")", str);
- }
+ case NOTE_INSN_BASIC_BLOCK:
+ {
+ basic_block bb = NOTE_BASIC_BLOCK (in_rtx);
+ if (bb != 0)
+ fprintf (outfile, " [bb %d]", bb->index);
+ break;
+ }
+
+ case NOTE_INSN_EXPECTED_VALUE:
+ indent += 2;
+ if (!sawclose)
+ fprintf (outfile, " ");
+ print_rtx (NOTE_EXPECTED_VALUE (in_rtx));
+ indent -= 2;
+ break;
+
+ default:
+ {
+ const char * const str = X0STR (in_rtx, i);
+
+ if (NOTE_LINE_NUMBER (in_rtx) < 0)
+ ;
+ else if (str == 0)
+ fputs (dump_for_graph ? " \\\"\\\"" : " \"\"", outfile);
+ else
+ {
+ if (dump_for_graph)
+ fprintf (outfile, " (\\\"%s\\\")", str);
+ else
+ fprintf (outfile, " (\"%s\")", str);
+ }
+ break;
+ }
}
}
break;