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
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 #define __STDC_LIMIT_MACROS
00063 #include <stdint.h>
00064 #if defined(BUILD_OS_DARWIN)
00065 #include <darwin_elf.h>
00066 #else
00067 #include <elf.h>
00068 #include <sys/elf_whirl.h>
00069 #endif
00070 #include <sys/types.h>
00071
00072 #include "defs.h"
00073 #include "ipa_section.h"
00074 #include "ipl_summary.h"
00075
00076 #ifndef IPA_SUMMARY
00077
00078 #include "ipc_file.h"
00079 #include "ipc_symtab_merge.h"
00080 #include "ipo_defs.h"
00081 #include "ipa_section_main.h"
00082
00083
00084
00085
00086 static SUMMARY_SYMBOL* IPA_Symbol = NULL;
00087
00088 void
00089 Init_IPA_Print_Arrays (IPA_NODE* node)
00090 {
00091 IPA_Symbol = IPA_get_symbol_array (node);
00092 IPA_get_ivar_array (node, IPA_Ivar_Count);
00093 }
00094
00095 static char*
00096 Symbol_Name(SUMMARY_SYMBOL* ss)
00097 {
00098 if (ST_IDX_level(ss->St_idx()) > GLOBAL_SYMTAB) {
00099 ST_IDX func_st_idx = ss->Get_st_idx_func();
00100 PU_IDX pu_idx = ST_pu(&St_Table[func_st_idx]);
00101 NODE_INDEX node_index = AUX_PU_node(Aux_Pu_Table[pu_idx]);
00102 IPA_NODE* cnode = IPA_Call_Graph->Graph()->Node_User(node_index);
00103 IPA_NODE_CONTEXT context(cnode);
00104 return ST_name(ss->St_idx());
00105 }
00106 else {
00107 return ST_name(St_Table[ss->St_idx()]);
00108 }
00109 }
00110
00111 #else
00112
00113 #include "ipl_summarize.h"
00114
00115 extern SUMMARY *Summary;
00116 extern IVAR_ARRAY *Ivar;
00117
00118 #endif
00119
00120
00121
00122
00123 void LOOPINFO::Print_file(FILE *fp)
00124 {
00125 if (Is_messy_ub())
00126 fprintf(fp, "messy upper, ");
00127 else
00128 fprintf(fp, "not messy upper, ");
00129
00130 if (Is_messy_lb())
00131 fprintf(fp, "messy lower, ");
00132 else
00133 fprintf(fp, "not messy lower, ");
00134
00135 if (Is_messy_step())
00136 fprintf(fp, "messy step, ");
00137 else
00138 fprintf(fp, "not messy step, ");
00139
00140 if (Is_messy_bounds())
00141 fprintf(fp, "messy bounds \n");
00142
00143 fprintf(fp, "nest-level = %d \n", Get_nest_level());
00144
00145 fprintf(fp, "Lower bound terms: term array index = %d , count = %d \n",
00146 Get_lb_term_index(), Get_lb_term_count());
00147
00148 fprintf(fp, "Upper bound terms: term array index = %d , count = %d \n",
00149 Get_ub_term_index(), Get_ub_term_count());
00150
00151 fprintf(fp, "Step bound terms: term array index = %d , count = %d \n",
00152 Get_step_term_index(), Get_step_term_count());
00153
00154 }
00155
00156
00157
00158
00159
00160 void
00161 REGION_ARRAYS::Print_file(FILE* fp)
00162 {
00163 if (Is_bad_alias())
00164 fprintf(fp, "Has bad alias, ");
00165 if (Is_loop_invariant())
00166 fprintf(fp, "Is loop invariant, ");
00167 if (Is_use())
00168 fprintf(fp, "Is_use, ");
00169 else if (Is_def())
00170 fprintf(fp, "Is_def, ");
00171 else if (Is_passed())
00172 fprintf(fp, "Is_passed, ");
00173 else if (Is_may_def())
00174 fprintf(fp, "Is_may_def, ");
00175 else if (Is_may_use())
00176 fprintf(fp, "Is_may_use, ");
00177 else if (Is_formal())
00178 fprintf(fp, "Is_formal, ");
00179 else
00180 fprintf(fp, "UNKNOWN type. ");
00181
00182 fprintf(fp, "\nSymbol id = %d \n", _sym_index);
00183 fprintf(fp, "Element size = %d \n", _element_size);
00184
00185 fprintf(fp, "Id into PROJECTED_REGION_ARRAY = %d, count = %d \n",
00186 Get_idx(), Get_count());
00187 }
00188
00189
00190
00191
00192
00193 void
00194 PROJECTED_NODE::Print_file(FILE *fp)
00195 {
00196 fprintf(fp, "%smessy lower, ", Is_messy_lb() ? "" : "non-");
00197 fprintf(fp, "%smessy upper, ", Is_messy_ub() ? "" : "non-");
00198 fprintf(fp, "%smessy step, ", Is_messy_step() ? "" : "non-");
00199 fprintf(fp, "%sprojected", Is_unprojected() ? "NOT" : "");
00200 if (Is_assumed_shape())
00201 fprintf(fp, ", assumed_shape");
00202 fprintf(fp, "\n terms in lower: idx = %d, count = %d\n",
00203 Get_lb_term_index(), Get_lb_term_count());
00204 fprintf(fp, " terms in upper: idx = %d, count = %d\n",
00205 Get_ub_term_index(), Get_ub_term_count());
00206 fprintf(fp, " terms in step: idx = %d, count = %d \n",
00207 Get_step_term_index(), Get_step_term_count());
00208 if (Get_segment_length_term_count() > 0)
00209 fprintf(fp, " terms in segment length: idx = %d, count = %d\n",
00210 Get_segment_length_term_index(), Get_segment_length_term_count());
00211 if (Get_segment_stride_term_count() > 0)
00212 fprintf(fp, " terms in segment stride: idx = %d, count = %d\n",
00213 Get_segment_stride_term_index(), Get_segment_stride_term_count());
00214 }
00215
00216
00217
00218
00219
00220 void
00221 CFG_NODE_INFO::Print_file(FILE *fp)
00222 {
00223 if (Is_do_loop()) {
00224 fprintf(fp, "TYPE: CFG_DO_LOOP, loopinfo index = %d", Get_loop_index());
00225 if (Is_executed()) {
00226 fprintf(fp, "ALWAYS executed");
00227 }
00228 fprintf(fp, "\n");
00229 }
00230 else if (Is_if()) {
00231 fprintf(fp, "TYPE: CFG_IF\n");
00232 fprintf(fp, "ELSE cfg node index = %d \n", Get_else_index());
00233 }
00234 else if (Is_else()) {
00235 fprintf(fp, "TYPE: CFG_ELSE \n");
00236 fprintf(fp, "IF cfg node index = %d \n", Get_if_index());
00237 }
00238 else if (Is_entry()) {
00239 fprintf(fp, "TYPE: CFG_ENTRY \n");
00240 }
00241 else {
00242 fprintf(fp, "TYPE: UNKNOWN \n");
00243 }
00244
00245 fprintf(fp, "Control Dependence Index: %d\n", Get_cd_index());
00246
00247 if (Has_calls()) {
00248 fprintf(fp, "Has calls \n");
00249 }
00250
00251
00252 fprintf(fp,"array kills: offset into REGIONS_ARRAY = %d, count = %d\n",
00253 Get_def_index(), Get_def_count());
00254
00255
00256 fprintf(fp, "array uses: offset into REGIONS_ARRAY = %d, count = %d\n",
00257 Get_use_index(), Get_use_count());
00258
00259
00260 fprintf(fp,"array params: offset into REGIONS_ARRAY = %d, count = %d\n",
00261 Get_param_index(), Get_param_count());
00262
00263
00264 fprintf(fp,"array formals: offset into REGIONS_ARRAY = %d, count = %d\n",
00265 Get_formal_index(), Get_formal_count());
00266
00267
00268 fprintf(fp, "scalar info: offset into INT_ARRAY = %d, count = %d \n",
00269 Get_scalar_index(), Get_scalar_count());
00270 }
00271
00272
00273
00274
00275
00276 void
00277 PROJECTED_REGION::Print_file(FILE *fp)
00278 {
00279 if (Is_messy_region())
00280 fputs("messy region", fp);
00281 else
00282 fputs("non-messy region", fp);
00283
00284 if (Is_unprojected_region())
00285 fputs(", unprojected region, ", fp);
00286 else
00287 fputs(", projected region, ", fp);
00288
00289 fprintf(fp, "num dims = %d, depth = %d \n", Get_num_dims(), Get_depth());
00290
00291 if (Is_passed())
00292 fprintf(fp, "parameter array section, callsite_id = %d, actual_pos = %d\n",
00293 Get_callsite_id(), Get_actual_id());
00294
00295 fprintf(fp, "id into projected node array = %d \n", Get_id());
00296 }
00297
00298
00299
00300
00301 void
00302 LINEX::Print_file(FILE* fp)
00303 {
00304 for (INT i = 0; i < _larray.Elements(); ++i) {
00305 _larray[i].Print_file(fp);
00306 }
00307 }
00308
00309
00310
00311
00312 void
00313 LINEX::Print(FILE *fp)
00314 {
00315 #ifdef IPA_SUMMARY
00316 if (Trace_Sections) {
00317 if (_larray.Lastidx() == -1) {
00318 fprintf(TFile, "NULL linex \n");
00319 fprintf(stdout, "NULL linex \n");
00320 }
00321 }
00322 #endif
00323 for (INT i = 0; i <= _larray.Lastidx(); ++i) {
00324 _larray[i].Print(fp, FALSE);
00325 if (i < _larray.Lastidx()) {
00326 fprintf(fp, "+");
00327 }
00328 }
00329 }
00330
00331
00332
00333
00334
00335 void
00336 IVAR::Print (FILE* fp)
00337 {
00338 fprintf(fp, "IVAR: ");
00339 if (Is_Formal()) {
00340 fprintf(fp, "FORMAL_POSITION = %d, OFFSET = %d, MTYPE = %s\n",
00341 Formal_Position(), Offset(), Machine_Types[Mtype()].name);
00342 }
00343 else {
00344 fprintf(fp, "GLOBAL %s, OFFSET = %d, MTYPE = %s\n",
00345 ST_name(St_Idx()), Offset(), Machine_Types[Mtype()].name);
00346 }
00347 }
00348
00349
00350
00351
00352
00353
00354
00355 void IVAR::IPA_LNO_Print_File(FILE* fp, INT ivar_index)
00356 {
00357 fprintf(fp, "IVAR");
00358 if (ivar_index == -1) {
00359 fprintf(fp, ":");
00360 }
00361 else {
00362 fprintf(fp, "[%d]:", ivar_index);
00363 }
00364 if (Is_Formal()) {
00365 fprintf(fp, "FORMAL_POSITION = %d, OFFSET = %d, MTYPE = %s\n",
00366 Formal_Position(), Offset(), Machine_Types[Mtype()].name);
00367 }
00368 else {
00369 fprintf(fp, "GLOBAL %s, OFFSET = %d, MTYPE = %s\n",
00370 ST_name(St_Idx()), Offset(), Machine_Types[Mtype()].name);
00371 }
00372 }
00373
00374
00375
00376
00377 void
00378 TERM::Print(FILE *fp, BOOL newline)
00379 {
00380 switch (Get_type()) {
00381
00382 case LTKIND_NONE:
00383 fprintf(fp,"?");
00384 break;
00385
00386 case LTKIND_CONST:
00387 fprintf(fp,"%d", Get_coeff());
00388 break;
00389
00390 case LTKIND_LINDEX:
00391 fprintf(fp,"loop_index(%d)*%d", Get_desc(), Get_coeff());
00392 break;
00393
00394 case LTKIND_SUBSCR:
00395 fprintf(fp,"dim(%d)*%d", Get_desc(), Get_coeff());
00396 break;
00397
00398 case LTKIND_IV:
00399 fprintf(fp,"IVAR[%d]*%d", Get_desc(), Get_coeff());
00400 break;
00401 }
00402
00403 if (newline) {
00404 fprintf(fp, "\n");
00405 }
00406 }
00407
00408
00409
00410
00411 void
00412 TERM::Print_file (FILE* fp)
00413 {
00414 switch (Get_type())
00415 {
00416 case LTKIND_NONE:
00417 fprintf(fp,"unknown TERM\n");
00418 break;
00419
00420 case LTKIND_CONST:
00421 fprintf(fp,"CONST:+ %d\n", Get_coeff());
00422 break;
00423
00424 case LTKIND_LINDEX:
00425 fprintf(fp,"LINDEX: + loop_index(%d)*%d\n", Get_desc(), Get_coeff());
00426 break;
00427
00428 case LTKIND_SUBSCR:
00429 fprintf(fp,"SUBSCR: + dim(%d)*%d\n", Get_desc(), Get_coeff());
00430 break;
00431
00432 case LTKIND_IV:
00433 fprintf(fp,"IVAR: + IVAR[%d]*%d\n", Get_desc(), Get_coeff());
00434 break;
00435
00436 default:
00437 fprintf(fp, "UNKNOWN TYPE:%d something is wrong\n", Get_type());
00438 break;
00439 }
00440 }
00441
00442
00443
00444
00445
00446
00447
00448 void TERM::IPA_LNO_Print_File(FILE* fp,
00449 INT term_index)
00450 {
00451 if (term_index == -1)
00452 fprintf(fp, "TERM: ");
00453 else
00454 fprintf(fp, "TERM[%d]: ", term_index);
00455 switch (Get_type()) {
00456 case LTKIND_NONE:
00457 fprintf(fp, "NONE ");
00458 break;
00459 case LTKIND_CONST:
00460 fprintf(fp, "CONST(%d)", Get_coeff());
00461 break;
00462 case LTKIND_LINDEX:
00463 fprintf(fp, "LINDEX(%d) * (%d) ", Get_desc(), Get_coeff());
00464 break;
00465 case LTKIND_SUBSCR:
00466 fprintf(fp, "SUBSCR(%d) * (%d) ", Get_desc(), Get_coeff());
00467 break;
00468 case LTKIND_IV:
00469 fprintf(fp, "IVAR[%d] * (%d) ", Get_desc(), Get_coeff());
00470 break;
00471 default:
00472 fprintf(fp, " ");
00473 break;
00474 }
00475 fprintf(fp, "\n");
00476 }
00477
00478
00479
00480
00481 void
00482 SCALAR_INFO::Print_file(FILE *fp)
00483 {
00484 fprintf(fp, "SCALAR_INFO: ");
00485 fprintf(fp, "id:%d, call_id:%d, TYPE: ", Get_id(), Get_callsite_id());
00486 if (Is_may_kill())
00487 fprintf(fp, "may kill: ");
00488 if (Is_may_use())
00489 fprintf(fp, "may use: ");
00490 if (Is_may_reduc())
00491 fprintf(fp, "may reduc: ");
00492 if (Is_kill())
00493 fprintf(fp, "kill: ");
00494 if (Is_use())
00495 fprintf(fp, "use: ");
00496 if (Is_euse())
00497 fprintf(fp, "euse: ");
00498 if (Is_call_euse())
00499 fprintf(fp, "call euse: ");
00500 if (Is_reduc())
00501 fprintf(fp, "reduc: ");
00502 if (Is_array_reduc())
00503 fprintf(fp, "array reduc: ");
00504 if (Is_array_may_reduc())
00505 fprintf(fp, "may array reduc: ");
00506 if (Is_passed_ref())
00507 fprintf(fp, "passed ref: ");
00508 if (Is_may_passed_ref())
00509 fprintf(fp, "may passed ref: ");
00510 fprintf(fp, "\n");
00511 }
00512
00513
00514
00515 void PROJECTED_KERNEL::Print(FILE *fp)
00516 {
00517 INT i;
00518
00519 fprintf(fp, "+++++PROJECTED_KERNEL_START+++++\n");
00520
00521 if (Is_messy_kernel())
00522 fprintf(fp, "messy, ");
00523 else
00524 fprintf(fp, "non-messy, ");
00525
00526 if (Is_projected())
00527 fprintf(fp, "projected, ");
00528 else
00529 fprintf(fp, "unprojected, ");
00530
00531 fprintf(fp, "num dims = %d, ", Get_num_dims());
00532 fprintf(fp, "depth = %d, ", Get_depth());
00533 fprintf(fp, "proj level = %d ", Get_projected_level());
00534 fprintf(fp, "\n");
00535
00536
00537 fprintf(fp, "is_independent = [");
00538 for (i = 0; i < Get_depth(); i++) {
00539 if (Is_independent(i))
00540 fprintf(fp, "TRUE");
00541 else
00542 fprintf(fp, "FALSE");
00543 if (i < Get_depth() - 1)
00544 fprintf(fp, ",");
00545 }
00546 fprintf(fp, "]\n");
00547 for (i=0; i < Get_num_dims(); ++i) {
00548 LINEX *l;
00549 if (l = Get_linex(i)) {
00550 fprintf(fp, "input_linex[%d] = ", i);
00551 l->Print(fp);
00552 fprintf(fp, "\n");
00553 }
00554 }
00555 if (Get_region() != NULL)
00556 fprintf(fp, "region = 0x%p\n", Get_region());
00557 for (i = 0; i < Get_num_dims(); i++) {
00558 LINEX *l;
00559 if (l = Get_Difference(i)) {
00560 fprintf(fp, "difference[%d] = ", i);
00561 l->Print(fp);
00562 fprintf(fp, "\n");
00563 }
00564 }
00565 fprintf(fp, "+++++PROJECTED_KERNEL_FINISHED+++++\n");
00566 }
00567
00568
00569
00570
00571 void LOOPINFO::Print(FILE *fp)
00572 {
00573 LINEX *l;
00574 INT i;
00575
00576 fprintf(fp, "\n+++++LOOPINFO_START+++++\n");
00577 if (Is_messy_ub())
00578 fprintf(fp, "messy upper, ");
00579 else
00580 fprintf(fp, "not messy upper, ");
00581
00582 if (Is_messy_lb())
00583 fprintf(fp, "messy lower, ");
00584 else
00585 fprintf(fp, "not messy lower, ");
00586
00587 if (Is_messy_step())
00588 fprintf(fp, "messy step, ");
00589 else
00590 fprintf(fp, "not messy step, ");
00591
00592 if (Is_messy_bounds())
00593 fprintf(fp, "messy bounds \n");
00594
00595 fprintf(fp, "nest-level = %d\n", Get_nest_level());
00596
00597 l = Get_lower_linex();
00598 if (l)
00599 {
00600 fprintf(fp, "\n Lower bound linex \n");
00601 l->Print(fp);
00602 }
00603 else
00604 fprintf(fp, "\n NULL lower bound linex \n");
00605
00606
00607 l = Get_upper_linex();
00608 if (l)
00609 {
00610 fprintf(fp, "\n Upper bound linex \n");
00611 l->Print(fp);
00612 }
00613 else
00614 fprintf(fp, "\n NULL upper bound linex \n");
00615
00616
00617 l = Get_step_linex();
00618 if (l)
00619 {
00620 fprintf(fp, "\n Step linex \n");
00621 l->Print(fp);
00622 }
00623 else
00624 fprintf(fp, "\n NULL step linex \n");
00625
00626 if (Get_kernels() != NULL)
00627 {
00628 PROJECTED_KERNEL_ARRAY *k = Get_kernels();
00629 for (i=0; i<k->Lastidx();++i)
00630 {
00631 PROJECTED_KERNEL* kernel = &(*k)[i];
00632 kernel->Print(fp);
00633 }
00634 }
00635
00636 fprintf(fp, "+++++LOOPINFO_FINISHED+++++\n");
00637 }
00638
00639
00640
00641
00642
00643 void PROJECTED_NODE::Print(FILE* fp)
00644 {
00645 LINEX* l;
00646
00647 fprintf(fp, "[");
00648
00649 if (Is_messy_lb()) {
00650 fprintf(fp, "messy");
00651 }
00652 else if (l = Get_lower_linex()) {
00653 l->Print(fp);
00654 }
00655 else {
00656 fprintf(fp, "?");
00657 }
00658
00659 fprintf(fp, ":");
00660
00661 if (Is_messy_ub()) {
00662 fprintf(fp, "messy");
00663 }
00664 else if (l = Get_upper_linex()) {
00665 l->Print(fp);
00666 }
00667 else {
00668 fprintf(fp, "?");
00669 }
00670
00671 fprintf(fp, ":");
00672
00673 if (Is_messy_step()) {
00674 fprintf(fp, "messy");
00675 }
00676 else if (l = Get_step_linex()) {
00677 l->Print(fp);
00678 }
00679 else {
00680 fprintf(fp, "?");
00681 }
00682
00683 if (Get_segment_length_linex() && Get_segment_stride_linex()) {
00684 fprintf(fp, ":");
00685 Get_segment_length_linex()->Print(fp);
00686 fprintf(fp, ":");
00687 Get_segment_stride_linex()->Print(fp);
00688 }
00689
00690 fprintf(fp, "]");
00691 fflush(fp);
00692 }
00693
00694
00695
00696
00697
00698
00699
00700 void PROJECTED_NODE::IPA_LNO_Print_File(FILE* fp,
00701 INT pn_index)
00702 {
00703 if (pn_index == -1)
00704 fprintf(fp, "PROJ_NODE: ");
00705 else
00706 fprintf(fp, "PROJ_NODE[%d]: ", pn_index);
00707 if (Is_unprojected()) {
00708 fprintf(fp, "<UNPROJECTED> TERM[%d:%d] ",
00709 Get_lb_term_index(), Get_lb_term_count());
00710 } else {
00711 if (Is_messy_lb())
00712 fprintf(fp, "LB <MESSY> ");
00713 else
00714 fprintf(fp, "LB TERM[%d:%d] ", Get_lb_term_index(),
00715 Get_lb_term_count());
00716 if (Is_messy_ub())
00717 fprintf(fp, "UB <MESSY> ");
00718 else
00719 fprintf(fp, "UB TERM[%d:%d] ", Get_ub_term_index(),
00720 Get_ub_term_count());
00721 if (Is_messy_step())
00722 fprintf(fp, "STEP <MESSY> ");
00723 else
00724 fprintf(fp, "STEP TERM[%d:%d] ", Get_step_term_index(),
00725 Get_step_term_count());
00726 fprintf(fp, "\n ");
00727 fprintf(fp, "SEG LEN TERM[%d:%d] ", Get_segment_length_term_index(),
00728 Get_segment_length_term_count());
00729 fprintf(fp, "SEG STR TERM[%d:%d] ", Get_segment_stride_term_index(),
00730 Get_segment_stride_term_count());
00731 }
00732 if (Is_assumed_shape())
00733 fprintf(fp, "<ASSUMED_SHAPE> ");
00734 fprintf(fp, "\n");
00735 }
00736
00737
00738
00739
00740 void PROJECTED_REGION::Print(FILE *fp)
00741 {
00742 if (Is_unprojected_region()) {
00743 fprintf(fp, "UN-");
00744 }
00745 fprintf(fp, "PROJECTED_REGION: ");
00746
00747 if (Is_messy_region()) {
00748 fprintf(fp, "messy region");
00749 }
00750 else {
00751 PROJECTED_ARRAY* pa = Get_projected_array();
00752 if (pa && pa != (void*)-1) {
00753 for (INT i = 0; i < Get_num_dims(); ++i) {
00754 Get_projected_node(i)->Print(fp);
00755 }
00756 }
00757 }
00758
00759 fprintf(fp, " depth = %d\n", Get_depth());
00760
00761 #ifdef IPA_SUMMARY
00762 if (Is_passed())
00763 fprintf(fp, "parameter array section, callsite_id = %d, actual_pos = %d\n",
00764 Get_callsite_id(), Get_actual_id());
00765 fprintf(fp, "\n");
00766
00767
00768 PROJECTED_KERNEL* p;
00769 if (p = Get_projected_kernel())
00770 p->Print(fp);
00771 fprintf(fp, "\n");
00772 #endif
00773 }
00774
00775
00776
00777
00778
00779
00780
00781 void PROJECTED_REGION::IPA_LNO_Print_File(FILE* fp,
00782 INT pr_index)
00783 {
00784 if (pr_index == -1)
00785 fprintf(fp, "PROJ_REGION: ");
00786 else
00787 fprintf(fp, "PROJ_REGION[%d]: ", pr_index);
00788 fprintf(fp, "PROJ_NODE[%d:%d] ", Get_id(),
00789 Get_num_dims());
00790 fprintf(fp, "DEPTH(%d) ", Get_depth());
00791 if (Is_messy_region())
00792 fprintf(fp, "<MESSY> ");
00793 if (Is_unprojected_region())
00794 fprintf(fp, "<UNPROJECTED> ");
00795 if (Is_may_kill()) {
00796 fprintf(fp, "MAY_KILL ");
00797 } else if (Is_may_use()) {
00798 fprintf(fp, "MAY_USE ");
00799 } else if (Is_passed()) {
00800 fprintf(fp, " ");
00801 fprintf(fp, "\n");
00802 fprintf(fp, "PASSED ");
00803 fprintf(fp, "CALLSITE[%d] ", Get_callsite_id());
00804 fprintf(fp, "ACTUAL_POSITION(%d) ", Get_actual_id());
00805 } else if (Is_formal()) {
00806 fprintf(fp, "FORMAL ");
00807 }
00808 fprintf(fp, "\n");
00809 }
00810
00811
00812
00813
00814 void
00815 PROJECTED_REGION_INFO::Print(FILE *fp)
00816 {
00817 if (Get_projected_region())
00818 Get_projected_region()->Print(fp);
00819 }
00820
00821
00822
00823
00824 void
00825 REGION_ARRAYS::Print(FILE *fp)
00826 {
00827 fprintf(fp, "REGION_ARRAYS for ");
00828 #ifdef IPA_SUMMARY
00829 fprintf(fp, "%s", Summary->Get_symbol(Get_sym_id())->Get_Name());
00830 #else
00831 fprintf(fp, "%s", Symbol_Name(&IPA_Symbol[Get_sym_id()]));
00832 #endif
00833
00834 fprintf(fp, ", element size = %d, ", Get_element_size());
00835
00836 if (Is_bad_alias())
00837 fprintf(fp, "bad alias, ");
00838
00839 if (Is_loop_invariant())
00840 fprintf(fp, "loop invariant, ");
00841
00842 if (Is_def())
00843 fprintf(fp, "def\n");
00844 else if (Is_use())
00845 fprintf(fp, "use\n");
00846 else if (Is_passed())
00847 fprintf(fp, "passed\n");
00848 else if (Is_may_def())
00849 fprintf(fp, "may def\n");
00850 else if (Is_may_use())
00851 fprintf(fp, "may use\n");
00852 else if (Is_formal())
00853 fprintf(fp, "formal\n");
00854 else
00855 fprintf(fp, "UNKNOWN type\n");
00856
00857 if (PROJECTED_REGION_INFO_ARRAY* p = Get_projected_region_array()) {
00858 for (INT i = 0; i < p->Elements(); ++i) {
00859 (*p)[i].Print(fp);
00860 }
00861 }
00862 }
00863
00864
00865
00866
00867 void
00868 CFG_NODE_INFO::Print(FILE *fp)
00869 {
00870 if (Has_calls())
00871 fprintf(fp, "Has calls \n");
00872
00873 INT i;
00874
00875
00876 fprintf(fp," +++++++++ARRAY KILLS_START+++++++++\n");
00877 ARRAY_OF_REGION_ARRAYS* defs = Get_def_array();
00878 for (i = 0; i < defs->Elements(); ++i) {
00879 (*defs)[i].Print(fp);
00880 }
00881 fprintf(fp," +++++++++ARRAY KILLS_FINISHED+++++++++\n");
00882
00883
00884 ARRAY_OF_REGION_ARRAYS* uses = Get_use_array();
00885 fprintf(fp," +++++++++ARRAY EUSES_START+++++++++\n");
00886 for (i = 0 ; i < uses->Elements(); ++i) {
00887 (*uses)[i].Print(fp);
00888 }
00889 fprintf(fp," +++++++++ARRAY EUSES_FINISHED+++++++++\n");
00890
00891
00892 fprintf(fp," +++++++++SCALAR_INFO_START+++++++++\n");
00893 INT_ARRAY* scalar_defs = Get_scalar_def_array();
00894 for (i = 0; i < scalar_defs->Elements();++i) {
00895 SCALAR_INFO* idr = &(*scalar_defs)[i];
00896 #ifdef IPA_SUMMARY
00897 fprintf(fp, "symbol: %s\n", Summary->Get_symbol(idr->Get_id())->Get_Name());
00898 #else
00899 fprintf(fp, "symbol: %s\n", Symbol_Name(&IPA_Symbol[idr->Get_id()]));
00900 #endif
00901 }
00902 fprintf(fp," +++++++++SCALAR_INFO_FINISHED+++++++++\n");
00903 }