- dump_node_list(F, (firm_kind *)ent, prefix, (int(*)(firm_kind *))get_entity_n_accesses,
- (ir_node *(*)(firm_kind *, int))get_entity_access, "Accesses");
- dump_node_list(F, (firm_kind *)ent, prefix, (int(*)(firm_kind *))get_entity_n_references,
- (ir_node *(*)(firm_kind *, int))get_entity_reference, "References");
- }
-
- if (verbosity & dump_verbosity_accessStats) {
-#ifdef EXTENDED_ACCESS_STATS
- int n_acc = get_entity_n_accesses(ent);
- int max_depth = 0;
- int max_L_freq = -1;
- int max_S_freq = -1;
- int max_LA_freq = -1;
- int max_SA_freq = -1;
- int *L_freq;
- int *S_freq;
- int *LA_freq;
- int *SA_freq;
-
- /* Find maximal depth */
- for (i = 0; i < n_acc; ++i) {
- ir_node *acc = get_entity_access(ent, i);
- int depth = get_weighted_loop_depth(acc);
- max_depth = (depth > max_depth) ? depth : max_depth ;
- }
-
- L_freq = XMALLOCNZ(int, 4 * max_depth);
-
- S_freq = L_freq + 1*max_depth;
- LA_freq = L_freq + 2*max_depth;
- SA_freq = L_freq + 3*max_depth;
-
- for (i = 0; i < n_acc; ++i) {
- ir_node *acc = get_entity_access(ent, i);
- int depth = get_weighted_loop_depth(acc);
- assert(depth < max_depth);
- if (is_Load(acc) || is_Call(acc)) {
- L_freq[depth]++;
- max_L_freq = (depth > max_L_freq) ? depth : max_L_freq;
- if (addr_is_alloc(acc)) {
- LA_freq[depth]++;
- max_LA_freq = (depth > max_LA_freq) ? depth : max_LA_freq;
- }
- } else if (is_Store(acc)) {
- S_freq[depth]++;
- max_S_freq = (depth > max_S_freq) ? depth : max_S_freq;
- if (addr_is_alloc(acc)) {
- SA_freq[depth]++;
- max_SA_freq = (depth > max_SA_freq) ? depth : max_SA_freq;
- }
- } else {
- assert(0);
- }
- }
-
- if (max_L_freq >= 0) {
- char comma = ':';
-
- fprintf(F, "%s Load Stats", prefix);
- for (i = 0; i <= max_L_freq; ++i) {
- if (L_freq[i])
- fprintf(F, "%c %d x L%d", comma, L_freq[i], i);
- else
- fprintf(F, " ");
- comma = ',';
- }
- fprintf(F, "\n");
- }
- if (max_LA_freq >= 0) {
- //fprintf(F, "%s LoadA Stats", prefix);
- char comma = ':';
- for (i = 0; i <= max_LA_freq; ++i) {
- //if (LA_freq[i])
- //fprintf(F, "%c %d x LA%d", comma, LA_freq[i], i);
- //else
- //fprintf(F, " ");
- comma = ',';
- }
- fprintf(F, "\n");
- }
- if (max_S_freq >= 0) {
- char comma = ':';
-
- fprintf(F, "%s Store Stats", prefix);
- for (i = 0; i <= max_S_freq; ++i) {
- if (S_freq[i])
- fprintf(F, "%c %d x S%d", comma, S_freq[i], i);
- else
- fprintf(F, " ");
- comma = ',';
- }
- fprintf(F, "\n");
- }
- if (max_SA_freq >= 0) {
- //fprintf(F, "%s StoreAStats", prefix);
- char comma = ':';
- for (i = 0; i <= max_SA_freq; ++i) {
- //if (SA_freq[i])
- //fprintf(F, "%c %d x SA%d", comma, SA_freq[i], i);
- //else
- //fprintf(F, " ");
- comma = ',';
- }
- fprintf(F, "\n");
- }
-
- /* free allocated space */
- free(L_freq);
-#endif
- if (get_trouts_state() != outs_none) {
-#ifdef INTERPROCEDURAL_VIEW
- if (is_Method_type(get_entity_type(ent))) {
- fprintf(F, "%s Estimated #Calls: %lf\n", prefix, get_entity_estimated_n_calls(ent));
- fprintf(F, "%s Estimated #dynCalls: %lf\n", prefix, get_entity_estimated_n_calls(ent));
- } else {
- fprintf(F, "%s Estimated #Loads: %lf\n", prefix, get_entity_estimated_n_loads(ent));
- fprintf(F, "%s Estimated #Stores: %lf\n", prefix, get_entity_estimated_n_stores(ent));
- }
-#endif
- }