profile.c (50397) | profile.c (52284) |
---|---|
1/* Calculate branch probabilities, and basic block execution counts. | 1/* Calculate branch probabilities, and basic block execution counts. |
2 Copyright (C) 1990, 91-94, 96, 97, 1998 Free Software Foundation, Inc. | 2 Copyright (C) 1990, 91-94, 96-98, 1999 Free Software Foundation, Inc. |
3 Contributed by James E. Wilson, UC Berkeley/Cygnus Support; 4 based on some ideas from Dain Samples of UC Berkeley. 5 Further mangling by Bob Manson, Cygnus Support. 6 7This file is part of GNU CC. 8 9GNU CC is free software; you can redistribute it and/or modify 10it under the terms of the GNU General Public License as published by 11the Free Software Foundation; either version 2, or (at your option) 12any later version. 13 14GNU CC is distributed in the hope that it will be useful, 15but WITHOUT ANY WARRANTY; without even the implied warranty of 16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17GNU General Public License for more details. 18 19You should have received a copy of the GNU General Public License 20along with GNU CC; see the file COPYING. If not, write to | 3 Contributed by James E. Wilson, UC Berkeley/Cygnus Support; 4 based on some ideas from Dain Samples of UC Berkeley. 5 Further mangling by Bob Manson, Cygnus Support. 6 7This file is part of GNU CC. 8 9GNU CC is free software; you can redistribute it and/or modify 10it under the terms of the GNU General Public License as published by 11the Free Software Foundation; either version 2, or (at your option) 12any later version. 13 14GNU CC is distributed in the hope that it will be useful, 15but WITHOUT ANY WARRANTY; without even the implied warranty of 16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17GNU General Public License for more details. 18 19You should have received a copy of the GNU General Public License 20along with GNU CC; see the file COPYING. If not, write to |
21the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | 21the Free Software Foundation, 59 Temple Place - Suite 330, 22Boston, MA 02111-1307, USA. */ |
22 23/* ??? Really should not put insns inside of LIBCALL sequences, when putting 24 insns after a call, should look for the insn setting the retval, and 25 insert the insns after that one. */ 26 27/* ??? Register allocation should use basic block execution counts to 28 give preference to the most commonly executed blocks. */ 29 --- 18 unchanged lines hidden (view full) --- 48#include "insn-config.h" 49#include "output.h" 50#include "regs.h" 51#include "tree.h" 52#include "output.h" 53#include "gcov-io.h" 54#include "toplev.h" 55 | 23 24/* ??? Really should not put insns inside of LIBCALL sequences, when putting 25 insns after a call, should look for the insn setting the retval, and 26 insert the insns after that one. */ 27 28/* ??? Register allocation should use basic block execution counts to 29 give preference to the most commonly executed blocks. */ 30 --- 18 unchanged lines hidden (view full) --- 49#include "insn-config.h" 50#include "output.h" 51#include "regs.h" 52#include "tree.h" 53#include "output.h" 54#include "gcov-io.h" 55#include "toplev.h" 56 |
56extern char * xmalloc (); 57 | |
58/* One of these is dynamically created whenever we identify an arc in the 59 function. */ 60 61struct adj_list 62{ 63 int source; 64 int target; 65 int arc_count; --- 1337 unchanged lines hidden (view full) --- 1403 if (arcptr->on_tree && ! bb_graph[ARC_SOURCE (arcptr)].on_tree) 1404 expand_spanning_tree (ARC_SOURCE (arcptr)); 1405} 1406 1407/* Perform file-level initialization for branch-prob processing. */ 1408 1409void 1410init_branch_prob (filename) | 57/* One of these is dynamically created whenever we identify an arc in the 58 function. */ 59 60struct adj_list 61{ 62 int source; 63 int target; 64 int arc_count; --- 1337 unchanged lines hidden (view full) --- 1402 if (arcptr->on_tree && ! bb_graph[ARC_SOURCE (arcptr)].on_tree) 1403 expand_spanning_tree (ARC_SOURCE (arcptr)); 1404} 1405 1406/* Perform file-level initialization for branch-prob processing. */ 1407 1408void 1409init_branch_prob (filename) |
1411 char *filename; | 1410 const char *filename; |
1412{ 1413 long len; 1414 int i; 1415 1416 if (flag_test_coverage) 1417 { 1418 /* Open an output file for the basic block/line number map. */ 1419 int len = strlen (filename); --- 243 unchanged lines hidden (view full) --- 1663 free (name); 1664 1665 fndecl = build_decl (FUNCTION_DECL, fnname, 1666 build_function_type (void_type_node, NULL_TREE)); 1667 DECL_EXTERNAL (fndecl) = 0; 1668 TREE_PUBLIC (fndecl) = 1; 1669 DECL_ASSEMBLER_NAME (fndecl) = fnname; 1670 DECL_RESULT (fndecl) = build_decl (RESULT_DECL, NULL_TREE, void_type_node); | 1411{ 1412 long len; 1413 int i; 1414 1415 if (flag_test_coverage) 1416 { 1417 /* Open an output file for the basic block/line number map. */ 1418 int len = strlen (filename); --- 243 unchanged lines hidden (view full) --- 1662 free (name); 1663 1664 fndecl = build_decl (FUNCTION_DECL, fnname, 1665 build_function_type (void_type_node, NULL_TREE)); 1666 DECL_EXTERNAL (fndecl) = 0; 1667 TREE_PUBLIC (fndecl) = 1; 1668 DECL_ASSEMBLER_NAME (fndecl) = fnname; 1669 DECL_RESULT (fndecl) = build_decl (RESULT_DECL, NULL_TREE, void_type_node); |
1670 1671 fndecl = pushdecl (fndecl); 1672 rest_of_decl_compilation (fndecl, 0, 1, 0); 1673 announce_function (fndecl); |
|
1671 current_function_decl = fndecl; | 1674 current_function_decl = fndecl; |
1675 DECL_INITIAL (fndecl) = error_mark_node; 1676 temporary_allocation (); |
|
1672 pushlevel (0); 1673 make_function_rtl (fndecl); 1674 init_function_start (fndecl, input_filename, lineno); 1675 expand_function_start (fndecl, 0); 1676 1677 /* Actually generate the code to call __bb_init_func. */ 1678 name = xmalloc (20); 1679 ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 0); --- 23 unchanged lines hidden --- | 1677 pushlevel (0); 1678 make_function_rtl (fndecl); 1679 init_function_start (fndecl, input_filename, lineno); 1680 expand_function_start (fndecl, 0); 1681 1682 /* Actually generate the code to call __bb_init_func. */ 1683 name = xmalloc (20); 1684 ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 0); --- 23 unchanged lines hidden --- |