00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef value_profile_INCLUDED
00029 #define value_profile_INCLUDED "val_prof.h"
00030
00031
00032 #include "cxx_memory.h"
00033 #include "profile_com.h"
00034 #include "tn.h"
00035 #include "instr_reader.h"
00036 #include "glob.h"
00037 #include "fb_freq.h"
00038 #include "fb_info.h"
00039 #include "const.h"
00040 #include "op.h"
00041 #include "mempool.h"
00042 #include "profile_util.h"
00043 #include "calls.h"
00044 #include "bb_map.h"
00045
00046 struct INST_TO_PROFILE {
00047 private:
00048 TOP _opcode;
00049 INT _count;
00050 BOOL _instr_before;
00051
00052 public:
00053 INST_TO_PROFILE(TOP opcode, INT count, BOOL instr_before):
00054 _opcode(opcode), _count(count), _instr_before(instr_before)
00055 {}
00056 INST_TO_PROFILE(TOP opcode, BOOL instr_before):
00057 _opcode(opcode), _count(0), _instr_before(instr_before)
00058 {}
00059 ~INST_TO_PROFILE(){}
00060
00061 TOP Opcode() const { return _opcode; }
00062 BOOL Is_instr_before() const { return _instr_before; }
00063 void Increase_count() { _count ++; }
00064 };
00065
00066
00067 typedef mempool_allocator<struct INST_TO_PROFILE *> INST2PROF_ALLOC_TYPE;
00068 typedef std::vector<INST_TO_PROFILE *, INST2PROF_ALLOC_TYPE> INST2PROFLIST;
00069
00070
00071
00072 extern INST2PROFLIST inst2prof_list;
00073 extern OP_MAP op_tnv_map;
00074 extern OP_MAP op_stride_tnv_map;
00075 extern void CG_VALUE_Instrument(CGRIN *rin, PROFILE_PHASE phase,BOOL stride_profiling_flag, BOOL do_value);
00076 extern void CG_VALUE_Annotate(CGRIN *rin, PROFILE_PHASE phase);
00077
00078
00079 #define VAL_PROF_FLAG 121
00080 #define SRD_PROF_FLAG 131
00081 #define INVOKE_VALUE_INSTRUMENT_NAME "__value_profile_invoke"
00082 #define INVOKE_VALUE_INSTRUMENT_INIT_NAME "__value_profile_pu_init"
00083 #define INVOKE_STRIDE_INSTRUMENT_NAME "__stride_profile_invoke"
00084 #define INVOKE_STRIDE_INSTRUMENT_INIT_NAME "__stride_profile_pu_init"
00085
00086 #define FIRST_OUTPUT_REG (127+REGISTER_MIN)
00087 #define RETURN_REG (8+REGISTER_MIN)
00088 #define FLOAT_RETURN_REG (8+REGISTER_MIN)
00089 #define RETURN_ADDRESS_REGNUM 329
00090
00091 #define FIRST_INPUT_REG (32+REGISTER_MIN)
00092
00093
00094 #endif