#include "cxx_memory.h"#include "profile_com.h"#include "tn.h"#include "instr_reader.h"#include "glob.h"#include "fb_freq.h"#include "fb_info.h"#include "const.h"#include "op.h"#include "mempool.h"#include "profile_util.h"#include "wn.h"


Go to the source code of this file.
Data Types | |
| module | PROFILE_MEM |
| module | PROFILE |
| module | EDGE_PROFILE |
Defines | |
| #define | INSTR_INIT_NAME "__profile_init" |
| #define | PU_INIT_NAME "__profile_pu_init" |
| #define | EDGE_INST_NAME "__profile_edge" |
| #define | FIRST_INPUT_REG (32+REGISTER_MIN) |
| #define | FIRST_LOCAL_REG (32+REGISTER_MIN) |
| #define | FIRST_OUTPUT_REG (127+REGISTER_MIN) |
| #define | LAST_STACKED_REG (127+REGISTER_MIN) |
| #define | FIRST_ROTATING_INTEGER_REG (32+REGISTER_MIN) |
| #define | FIRST_ROTATING_FLOAT_REG (32+REGISTER_MIN) |
| #define | FIRST_ROTATING_PREDICATE_REG (16+REGISTER_MIN) |
| #define | LAST_ROTATING_INTEGER_REG (127+REGISTER_MIN) |
| #define | LAST_ROTATING_FLOAT_REG (127+REGISTER_MIN) |
| #define | LAST_ROTATING_PREDICATE_REG (63+REGISTER_MIN) |
| #define | RETURN_REG (8+REGISTER_MIN) |
| #define | RETURN_REG1 (8+REGISTER_MIN) |
| #define | RETURN_REG2 (9+REGISTER_MIN) |
| #define | RETURN_REG3 (10+REGISTER_MIN) |
| #define | RETURN_REG4 (11+REGISTER_MIN) |
| #define | FLOAT_RETURN_REG (8+REGISTER_MIN) |
| #define | FLOAT_RETURN_REG1 (8+REGISTER_MIN) |
| #define | FLOAT_RETURN_REG2 (9+REGISTER_MIN) |
| #define | FLOAT_RETURN_REG3 (10+REGISTER_MIN) |
| #define | FLOAT_RETURN_REG4 (11+REGISTER_MIN) |
| #define | FLOAT_RETURN_REG5 (12+REGISTER_MIN) |
| #define | FLOAT_RETURN_REG6 (13+REGISTER_MIN) |
| #define | FLOAT_RETURN_REG7 (14+REGISTER_MIN) |
| #define | FLOAT_RETURN_REG8 (15+REGISTER_MIN) |
| #define | BBlist_Alloc(void) TYPE_PU_ALLOC(BBLIST) |
| #define | ERROR_FREQ(freq) freq < 0.0 |
| #define | ERROR_PROB(prob) prob < 0.0 |
| #define | UNINIT_FREQ(freq) freq < 0.0 |
| #define | UNINIT_PROB(prob) prob < 0.0 |
| #define | ZERO_FREQ(freq) freq == 0.0 |
| #define | ZERO_PROB(prob) prob == 0.0 |
| #define | FB_FREQ_UNINIT -1.0 |
| #define | FB_FREQ_UNKNOWN -2.0 |
| #define | FB_FREQ_ERROR -3.0 |
| #define | LABEL_IDX_NONE 0 |
Functions/Subroutines | |
| void | Compute_Edge_Freq_Base_Prob (void) |
| void | Compute_Edge_Prob_Base_Freq (void) |
| void | CG_Edge_Profile_Annotation (CGRIN *cgrin, PROFILE_PHASE phase) |
| void | CG_Edge_Profile_Instrument (CGRIN *cgrin, PROFILE_PHASE phase) |
| WN * | Gen_Call (char *name, WN *arg1, WN *arg2, TYPE_ID rtype=MTYPE_V) |
| WN * | Gen_Call_Shell (char *name, TYPE_ID rtype, INT32 argc) |
| INT32 | Curr_PU_BB_Count (void) |
| void | Init_CFG (void) |
| void | Change_BB_Label (BB *bb, LABEL_IDX i) |
| BB * | First_Branch_BB (void) |
| BOOL | Result_Tn_In_BB (BB *bb, TN *tn) |
| BOOL | Opnd_Tn_In_BB (BB *bb, TN *tn) |
| LABEL_IDX | Get_Br_Op_Tgt_Label (OP *branch_op) |
| INT32 | Get_Return_Reg_Sum (BB *bb) |
| INT32 | Get_Float_Return_Reg_Sum (BB *bb) |
| WN * | Gen_Param (WN *arg, UINT32 flag) |
Variables | |
| INT32 | current_PU_handle |
| BOOL | CG_PU_Has_Feedback |
| BOOL | FREQ_freqs_computed |
Definition at line 104 of file edge_profile.h.
| #define EDGE_INST_NAME "__profile_edge" |
Definition at line 67 of file edge_profile.h.
Referenced by EDGE_PROFILE::Instrument_Cloop_Branch(), EDGE_PROFILE::Instrument_Indirect_Cond_Branch(), EDGE_PROFILE::Instrument_Ip_Rel_Branch(), EDGE_PROFILE::Instrument_None_and_Other_Xfer(), and EDGE_PROFILE::Instrument_Top_Branch().
| #define ERROR_FREQ | ( | freq | ) | freq < 0.0 |
Definition at line 105 of file edge_profile.h.
Referenced by Compute_Edge_Freq_Base_Prob(), and Compute_Edge_Prob_Base_Freq().
| #define ERROR_PROB | ( | prob | ) | prob < 0.0 |
| #define FB_FREQ_ERROR -3.0 |
Definition at line 114 of file edge_profile.h.
| #define FB_FREQ_UNINIT -1.0 |
Definition at line 112 of file edge_profile.h.
Referenced by FEEDBACK::FB_lower_compgoto(), OPT_FEEDBACK::Get_edge_freq_by_type(), Init_CFG(), FB_Info_Switch::operator[](), OPT_FEEDBACK::OPT_FEEDBACK(), FEEDBACK::Query(), FEEDBACK::Query_prob(), FEEDBACK::Query_total_out(), and FB_CFG::Walk_WN_statement().
| #define FB_FREQ_UNKNOWN -2.0 |
Definition at line 113 of file edge_profile.h.
Referenced by IPO_INLINE::Clone_Callee(), Count_tree_size(), Count_tree_size_tuning(), OPT_FEEDBACK::Emit_feedback(), FEEDBACK::FB_convert_goto_to_loop(), FEEDBACK::FB_lower_call(), FEEDBACK::FB_lower_icall(), FEEDBACK::FB_lower_mstore_to_loop(), FEEDBACK::FB_move_goto_out(), FEEDBACK::FB_set_unknown_node(), IPA_NODE::Get_cycle_count(), IPA_NODE::Get_cycle_count_2(), IPA_NODE::Get_frequency(), IPA_EDGE::Get_frequency(), IPO_Clone(), lower_complex_expr(), OPT_FEEDBACK::OPT_FEEDBACK(), FEEDBACK::Query(), FEEDBACK::Query_prob(), vho_lower_cselect(), VHO_Switch_Generate_Binary_Search(), FB_CFG::Walk_WN_expression(), and FB_CFG::Walk_WN_statement().
| #define FIRST_INPUT_REG (32+REGISTER_MIN) |
Definition at line 77 of file edge_profile.h.
| #define FIRST_LOCAL_REG (32+REGISTER_MIN) |
Definition at line 78 of file edge_profile.h.
| #define FIRST_OUTPUT_REG (127+REGISTER_MIN) |
Definition at line 79 of file edge_profile.h.
| #define FIRST_ROTATING_FLOAT_REG (32+REGISTER_MIN) |
Definition at line 82 of file edge_profile.h.
| #define FIRST_ROTATING_INTEGER_REG (32+REGISTER_MIN) |
Definition at line 81 of file edge_profile.h.
| #define FIRST_ROTATING_PREDICATE_REG (16+REGISTER_MIN) |
Definition at line 83 of file edge_profile.h.
| #define FLOAT_RETURN_REG (8+REGISTER_MIN) |
Definition at line 94 of file edge_profile.h.
Referenced by EDGE_PROFILE::Gen_Call_BB(), and Get_Float_Return_Reg_Sum().
| #define FLOAT_RETURN_REG1 (8+REGISTER_MIN) |
Definition at line 95 of file edge_profile.h.
| #define FLOAT_RETURN_REG2 (9+REGISTER_MIN) |
Definition at line 96 of file edge_profile.h.
| #define FLOAT_RETURN_REG3 (10+REGISTER_MIN) |
Definition at line 97 of file edge_profile.h.
| #define FLOAT_RETURN_REG4 (11+REGISTER_MIN) |
Definition at line 98 of file edge_profile.h.
| #define FLOAT_RETURN_REG5 (12+REGISTER_MIN) |
Definition at line 99 of file edge_profile.h.
| #define FLOAT_RETURN_REG6 (13+REGISTER_MIN) |
Definition at line 100 of file edge_profile.h.
| #define FLOAT_RETURN_REG7 (14+REGISTER_MIN) |
Definition at line 101 of file edge_profile.h.
| #define FLOAT_RETURN_REG8 (15+REGISTER_MIN) |
Definition at line 102 of file edge_profile.h.
| #define INSTR_INIT_NAME "__profile_init" |
| #define LABEL_IDX_NONE 0 |
Definition at line 115 of file edge_profile.h.
Referenced by Get_Br_Op_Tgt_Label(), and EDGE_PROFILE::Instrument_Indirect_Cond_Branch().
| #define LAST_ROTATING_FLOAT_REG (127+REGISTER_MIN) |
Definition at line 85 of file edge_profile.h.
| #define LAST_ROTATING_INTEGER_REG (127+REGISTER_MIN) |
Definition at line 84 of file edge_profile.h.
| #define LAST_ROTATING_PREDICATE_REG (63+REGISTER_MIN) |
Definition at line 86 of file edge_profile.h.
| #define LAST_STACKED_REG (127+REGISTER_MIN) |
Definition at line 80 of file edge_profile.h.
| #define PU_INIT_NAME "__profile_pu_init" |
Definition at line 66 of file edge_profile.h.
Referenced by EDGE_PROFILE::Instrument_Entry(), and WN_INSTRUMENT_WALKER::Tree_Walk().
| #define RETURN_REG (8+REGISTER_MIN) |
Definition at line 88 of file edge_profile.h.
Referenced by EDGE_PROFILE::Gen_Call_BB(), Get_Return_Reg_Sum(), and EDGE_PROFILE::Prepare_Call_Init_Return_BB().
| #define RETURN_REG1 (8+REGISTER_MIN) |
Definition at line 89 of file edge_profile.h.
| #define RETURN_REG2 (9+REGISTER_MIN) |
Definition at line 90 of file edge_profile.h.
| #define RETURN_REG3 (10+REGISTER_MIN) |
Definition at line 91 of file edge_profile.h.
| #define RETURN_REG4 (11+REGISTER_MIN) |
Definition at line 92 of file edge_profile.h.
| #define UNINIT_FREQ | ( | freq | ) | freq < 0.0 |
Definition at line 107 of file edge_profile.h.
Referenced by EDGE_PROFILE::Propagate_Node_In(), and EDGE_PROFILE::Propagate_Node_Out().
| #define UNINIT_PROB | ( | prob | ) | prob < 0.0 |
Definition at line 108 of file edge_profile.h.
| #define ZERO_FREQ | ( | freq | ) | freq == 0.0 |
| #define ZERO_PROB | ( | prob | ) | prob == 0.0 |
| void CG_Edge_Profile_Annotation | ( | CGRIN * | cgrin, | |
| PROFILE_PHASE | phase | |||
| ) |
Definition at line 121 of file edge_profile.cxx.
References EDGE_PROFILE::CG_Annotate(), CG_PU_Has_Feedback, Compute_Edge_Freq_Base_Prob(), Cur_PU_Name, CXX_NEW_ARRAY, DevWarn, Dump_Fb_Data(), edge_done, FALSE, Feedback_File_Info, FREQ_Compute_BB_Frequencies(), FREQ_freqs_computed, Get_CG_PU_Profile(), Get_Trace(), Init_CFG(), MEM_local_nz_pool, Src_File_Name, strcat(), strcpy, strlen(), TP_A_PROF, TRUE, and TT_PROF_FEEDBACK_DUMP.
Referenced by CG_Generate_Code().
| void CG_Edge_Profile_Instrument | ( | CGRIN * | cgrin, | |
| PROFILE_PHASE | phase | |||
| ) |
Definition at line 103 of file edge_profile.cxx.
References EDGE_PROFILE::CG_Instrument(), DevWarn, Instru_File_Name, Instrumentation_File_Name, NULL, Src_File_Name, and TRUE.
Referenced by CG_Generate_Code().
Definition at line 2026 of file edge_profile.cxx.
References ANNOT_Get(), ANNOT_LABEL, ANNOT_Unlink(), BB_Add_Annotation(), BB_annotations, NULL, and Set_Label_BB().
Referenced by EDGE_PROFILE::Instrument_Indirect_Cond_Branch().
Definition at line 1975 of file edge_profile.cxx.
References BB_freq, BB_id, BB_next, BB_succs, BBLIST_next, BBLIST_prob, DevWarn, ERROR_FREQ, ERROR_PROB, NULL, and REGION_First_BB.
Referenced by CG_Edge_Profile_Annotation().
Definition at line 2001 of file edge_profile.cxx.
References BB_freq, BB_id, BB_next, BB_succs, BBlist_Len(), BBLIST_next, BBLIST_prob, DevWarn, ERROR_FREQ, INT32, len, NULL, REGION_First_BB, and ZERO_FREQ.
Referenced by EDGE_PROFILE::CG_Annotate().
Definition at line 1822 of file edge_profile.cxx.
References BB_next, count, INT32, NULL, and REGION_First_BB.
Referenced by EDGE_PROFILE::CG_Instrument().
Definition at line 2037 of file edge_profile.cxx.
References BB_kind(), BB_next, BBKIND_INDGOTO, BBKIND_LOGIF, BBKIND_VARGOTO, NULL, and REGION_First_BB.
Definition at line 87 of file edge_profile.cxx.
References call(), Gen_Call_Shell(), Gen_Param(), WN_actual, and WN_PARM_BY_VALUE.
Referenced by OUTPUT_FUNC_START_PROFILER::Fill_In_Func_Body(), EDGE_PROFILE::Gen_Call_BB(), WN_INSTRUMENT_WALKER::Initialize_Instrumenter_Branch(), WN_INSTRUMENT_WALKER::Initialize_Instrumenter_Call(), WN_INSTRUMENT_WALKER::Initialize_Instrumenter_Circuit(), WN_INSTRUMENT_WALKER::Initialize_Instrumenter_Icall(), WN_INSTRUMENT_WALKER::Initialize_Instrumenter_Invoke(), WN_INSTRUMENT_WALKER::Initialize_Instrumenter_Loop(), WN_INSTRUMENT_WALKER::Instrument_Branch(), WN_INSTRUMENT_WALKER::Instrument_Call(), WN_INSTRUMENT_WALKER::Instrument_Circuit(), WN_INSTRUMENT_WALKER::Instrument_Compgoto(), WN_INSTRUMENT_WALKER::Instrument_Cselect(), WN_INSTRUMENT_WALKER::Instrument_Icall(), WN_INSTRUMENT_WALKER::Instrument_Invoke(), WN_INSTRUMENT_WALKER::Instrument_Loop(), WN_INSTRUMENT_WALKER::Instrument_Switch(), and WN_INSTRUMENT_WALKER::Tree_Walk().
Definition at line 71 of file edge_profile.cxx.
References Clear_PU_is_pure(), Clear_PU_no_side_effects(), Gen_Intrinsic_Function(), Make_Function_Type(), MTYPE_To_TY, MTYPE_V, Pu_Table, Set_PU_no_delete(), ST_pu(), WN_Call, and WN_Set_Call_Default_Flags.
Referenced by Gen_Call(), Gen_Call_ref3(), and Gen_Call_ref35().
Definition at line 349 of file edge_profile.h.
References MTYPE_To_TY, WN_CreateParm, and WN_rtype().
Referenced by Gen_Call(), Gen_Call_ref3(), and Gen_Call_ref35().
Definition at line 2081 of file edge_profile.cxx.
References i, INT, LABEL_IDX_NONE, OP_opnd, OP_opnds, TN_is_label, and TN_label.
Referenced by EDGE_PROFILE::Instrument_Cloop_Branch(), EDGE_PROFILE::Instrument_Entry(), EDGE_PROFILE::Instrument_Indirect_Cond_Branch(), EDGE_PROFILE::Instrument_Ip_Rel_Branch(), and EDGE_PROFILE::Instrument_Top_Branch().
Definition at line 2128 of file edge_profile.cxx.
References Build_Dedicated_TN(), ops::first, FLOAT_RETURN_REG, i, ops::last, NULL, OP_next, OP_opnd, OP_opnds, OP_result, OP_results, opcode, and bb::ops.
Definition at line 2096 of file edge_profile.cxx.
References Build_Dedicated_TN(), ops::first, i, ops::last, NULL, OP_next, OP_opnd, OP_opnds, OP_result, OP_results, opcode, bb::ops, and RETURN_REG.
Definition at line 1830 of file edge_profile.cxx.
References BB_next, BB_succs, BBLIST_next, FB_FREQ_UNINIT, NULL, and REGION_First_BB.
Referenced by CG_Edge_Profile_Annotation().
Definition at line 2049 of file edge_profile.cxx.
References FALSE, ops::first, i, NULL, OP_next, OP_result, OP_results, opcode, bb::ops, and TRUE.
Definition at line 331 of file edge_profile.h.
Referenced by BBlist_Add_BB_with_Prob(), Calculate_Path_Priorities(), CFLOW_Initialize(), CG_Edge_Profile_Annotation(), CG_Generate_Code(), Compute_Branch_Probabilities(), Detect_SWP_Constraints(), Determine_Candidate_Blocks(), Expand_Statement(), FREQ_Print_BB_Note(), FREQ_Verify(), and Maximum_Sched_Height_Increase().
Referenced by CG_Generate_Code(), and EDGE_PROFILE::EDGE_PROFILE().
Definition at line 101 of file freq.cxx.
Referenced by CG_Edge_Profile_Annotation(), Finalize_Compute_BB_Frequencies(), FREQ_Frequencies_Computed(), FREQ_Print_BB_Note(), and FREQ_Region_Initialize().
1.5.6