Mercurial > hg > CbC > CbC_gcc
comparison gcc/df.h @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | b7f97abdc517 |
children | 04ced10e8804 |
comparison
equal
deleted
inserted
replaced
65:65488c3d617d | 67:f6334be47118 |
---|---|
32 #include "basic-block.h" | 32 #include "basic-block.h" |
33 #include "alloc-pool.h" | 33 #include "alloc-pool.h" |
34 #include "timevar.h" | 34 #include "timevar.h" |
35 | 35 |
36 struct dataflow; | 36 struct dataflow; |
37 struct df; | 37 struct df_d; |
38 struct df_problem; | 38 struct df_problem; |
39 struct df_link; | 39 struct df_link; |
40 struct df_insn_info; | 40 struct df_insn_info; |
41 union df_ref_d; | 41 union df_ref_d; |
42 | 42 |
50 #define DF_SCAN 0 | 50 #define DF_SCAN 0 |
51 #define DF_LR 1 /* Live Registers backward. */ | 51 #define DF_LR 1 /* Live Registers backward. */ |
52 #define DF_LIVE 2 /* Live Registers & Uninitialized Registers */ | 52 #define DF_LIVE 2 /* Live Registers & Uninitialized Registers */ |
53 #define DF_RD 3 /* Reaching Defs. */ | 53 #define DF_RD 3 /* Reaching Defs. */ |
54 #define DF_CHAIN 4 /* Def-Use and/or Use-Def Chains. */ | 54 #define DF_CHAIN 4 /* Def-Use and/or Use-Def Chains. */ |
55 #define DF_BYTE_LR 5 /* Subreg tracking lr. */ | 55 #define DF_WORD_LR 5 /* Subreg tracking lr. */ |
56 #define DF_NOTE 6 /* REG_DEF and REG_UNUSED notes. */ | 56 #define DF_NOTE 6 /* REG_DEF and REG_UNUSED notes. */ |
57 #define DF_MD 7 /* Multiple Definitions. */ | 57 #define DF_MD 7 /* Multiple Definitions. */ |
58 | 58 |
59 #define DF_LAST_PROBLEM_PLUS1 (DF_MD + 1) | 59 #define DF_LAST_PROBLEM_PLUS1 (DF_MD + 1) |
60 | 60 |
64 DF_NONE, | 64 DF_NONE, |
65 DF_FORWARD, | 65 DF_FORWARD, |
66 DF_BACKWARD | 66 DF_BACKWARD |
67 }; | 67 }; |
68 | 68 |
69 /* Used in the byte scanning to determine if may or must info is to be | |
70 returned. */ | |
71 enum df_mm | |
72 { | |
73 DF_MM_MAY, | |
74 DF_MM_MUST | |
75 }; | |
76 | |
77 /* Descriminator for the various df_ref types. */ | 69 /* Descriminator for the various df_ref types. */ |
78 enum df_ref_class {DF_REF_BASE, DF_REF_ARTIFICIAL, DF_REF_REGULAR, DF_REF_EXTRACT}; | 70 enum df_ref_class {DF_REF_BASE, DF_REF_ARTIFICIAL, DF_REF_REGULAR}; |
79 | 71 |
80 /* The first of these us a set of a registers. The remaining three | 72 /* The first of these us a set of a registers. The remaining three |
81 are all uses of a register (the mem_load and mem_store relate to | 73 are all uses of a register (the mem_load and mem_store relate to |
82 how the register as an addressing operand). */ | 74 how the register as an addressing operand). */ |
83 enum df_ref_type {DF_REF_REG_DEF, DF_REF_REG_USE, | 75 enum df_ref_type {DF_REF_REG_DEF, DF_REF_REG_USE, |
220 typedef void (*df_dataflow_function) (struct dataflow *, bitmap, int *, int); | 212 typedef void (*df_dataflow_function) (struct dataflow *, bitmap, int *, int); |
221 | 213 |
222 /* Confluence operator for blocks with 0 out (or in) edges. */ | 214 /* Confluence operator for blocks with 0 out (or in) edges. */ |
223 typedef void (*df_confluence_function_0) (basic_block); | 215 typedef void (*df_confluence_function_0) (basic_block); |
224 | 216 |
225 /* Confluence operator for blocks with 1 or more out (or in) edges. */ | 217 /* Confluence operator for blocks with 1 or more out (or in) edges. |
226 typedef void (*df_confluence_function_n) (edge); | 218 Return true if BB input data has changed. */ |
227 | 219 typedef bool (*df_confluence_function_n) (edge); |
228 /* Transfer function for blocks. */ | 220 |
221 /* Transfer function for blocks. | |
222 Return true if BB output data has changed. */ | |
229 typedef bool (*df_transfer_function) (int); | 223 typedef bool (*df_transfer_function) (int); |
230 | 224 |
231 /* Function to massage the information after the problem solving. */ | 225 /* Function to massage the information after the problem solving. */ |
232 typedef void (*df_finalizer_function) (bitmap); | 226 typedef void (*df_finalizer_function) (bitmap); |
233 | 227 |
275 df_dump_bb_problem_function dump_top_fun; | 269 df_dump_bb_problem_function dump_top_fun; |
276 df_dump_bb_problem_function dump_bottom_fun; | 270 df_dump_bb_problem_function dump_bottom_fun; |
277 df_verify_solution_start verify_start_fun; | 271 df_verify_solution_start verify_start_fun; |
278 df_verify_solution_end verify_end_fun; | 272 df_verify_solution_end verify_end_fun; |
279 struct df_problem *dependent_problem; | 273 struct df_problem *dependent_problem; |
274 unsigned int block_info_elt_size; | |
280 | 275 |
281 /* The timevar id associated with this pass. */ | 276 /* The timevar id associated with this pass. */ |
282 timevar_id_t tv_id; | 277 timevar_id_t tv_id; |
283 | 278 |
284 /* True if the df_set_blocks should null out the basic block info if | 279 /* True if the df_set_blocks should null out the basic block info if |
292 { | 287 { |
293 struct df_problem *problem; /* The problem to be solved. */ | 288 struct df_problem *problem; /* The problem to be solved. */ |
294 | 289 |
295 /* Array indexed by bb->index, that contains basic block problem and | 290 /* Array indexed by bb->index, that contains basic block problem and |
296 solution specific information. */ | 291 solution specific information. */ |
297 void **block_info; | 292 void *block_info; |
298 unsigned int block_info_size; | 293 unsigned int block_info_size; |
299 | 294 |
300 /* The pool to allocate the block_info from. */ | 295 /* The pool to allocate the block_info from. */ |
301 alloc_pool block_pool; | 296 alloc_pool block_pool; |
302 | 297 |
362 ENUM_BITFIELD(df_ref_class) cl : 8; | 357 ENUM_BITFIELD(df_ref_class) cl : 8; |
363 | 358 |
364 ENUM_BITFIELD(df_ref_type) type : 8; | 359 ENUM_BITFIELD(df_ref_type) type : 8; |
365 /* Type of ref. */ | 360 /* Type of ref. */ |
366 int flags : 16; /* Various df_ref_flags. */ | 361 int flags : 16; /* Various df_ref_flags. */ |
362 unsigned int regno; /* The register number referenced. */ | |
367 rtx reg; /* The register referenced. */ | 363 rtx reg; /* The register referenced. */ |
368 struct df_link *chain; /* Head of def-use, use-def. */ | 364 struct df_link *chain; /* Head of def-use, use-def. */ |
369 /* Pointer to the insn info of the containing instruction. FIXME! | 365 /* Pointer to the insn info of the containing instruction. FIXME! |
370 Currently this is NULL for artificial refs but this will be used | 366 Currently this is NULL for artificial refs but this will be used |
371 when FUDs are added. */ | 367 when FUDs are added. */ |
373 /* For each regno, there are three chains of refs, one for the uses, | 369 /* For each regno, there are three chains of refs, one for the uses, |
374 the eq_uses and the defs. These chains go thru the refs | 370 the eq_uses and the defs. These chains go thru the refs |
375 themselves rather than using an external structure. */ | 371 themselves rather than using an external structure. */ |
376 union df_ref_d *next_reg; /* Next ref with same regno and type. */ | 372 union df_ref_d *next_reg; /* Next ref with same regno and type. */ |
377 union df_ref_d *prev_reg; /* Prev ref with same regno and type. */ | 373 union df_ref_d *prev_reg; /* Prev ref with same regno and type. */ |
378 unsigned int regno; /* The register number referenced. */ | |
379 /* Location in the ref table. This is only valid after a call to | 374 /* Location in the ref table. This is only valid after a call to |
380 df_maybe_reorganize_[use,def]_refs which is an expensive operation. */ | 375 df_maybe_reorganize_[use,def]_refs which is an expensive operation. */ |
381 int id; | 376 int id; |
382 /* The index at which the operand was scanned in the insn. This is | 377 /* The index at which the operand was scanned in the insn. This is |
383 used to totally order the refs in an insn. */ | 378 used to totally order the refs in an insn. */ |
405 pointers that are also associated with call insns and so those | 400 pointers that are also associated with call insns and so those |
406 just use the base. */ | 401 just use the base. */ |
407 rtx *loc; | 402 rtx *loc; |
408 }; | 403 }; |
409 | 404 |
410 | |
411 /* A df_ref_extract is just a df_ref with a width and offset field at | |
412 the end of it. It is used to hold this information if the ref was | |
413 wrapped by a SIGN_EXTRACT or a ZERO_EXTRACT and to pass this info | |
414 to passes that wish to process partial regs precisely. */ | |
415 struct df_extract_ref | |
416 { | |
417 struct df_regular_ref base; | |
418 int width; | |
419 int offset; | |
420 enum machine_mode mode; | |
421 }; | |
422 | |
423 /* Union of the different kinds of defs/uses placeholders. */ | 405 /* Union of the different kinds of defs/uses placeholders. */ |
424 union df_ref_d | 406 union df_ref_d |
425 { | 407 { |
426 struct df_base_ref base; | 408 struct df_base_ref base; |
427 struct df_regular_ref regular_ref; | 409 struct df_regular_ref regular_ref; |
428 struct df_artificial_ref artificial_ref; | 410 struct df_artificial_ref artificial_ref; |
429 struct df_extract_ref extract_ref; | |
430 }; | 411 }; |
431 typedef union df_ref_d *df_ref; | 412 typedef union df_ref_d *df_ref; |
432 | 413 |
433 | 414 |
434 /* One of these structures is allocated for every insn. */ | 415 /* One of these structures is allocated for every insn. */ |
522 Problem data for the scanning dataflow problem. Unlike the other | 503 Problem data for the scanning dataflow problem. Unlike the other |
523 dataflow problems, the problem data for scanning is fully exposed and | 504 dataflow problems, the problem data for scanning is fully exposed and |
524 used by owners of the problem. | 505 used by owners of the problem. |
525 ----------------------------------------------------------------------------*/ | 506 ----------------------------------------------------------------------------*/ |
526 | 507 |
527 struct df | 508 struct df_d |
528 { | 509 { |
529 | 510 |
530 /* The set of problems to be solved is stored in two arrays. In | 511 /* The set of problems to be solved is stored in two arrays. In |
531 PROBLEMS_IN_ORDER, the problems are stored in the order that they | 512 PROBLEMS_IN_ORDER, the problems are stored in the order that they |
532 are solved. This is an internally dense array that may have | 513 are solved. This is an internally dense array that may have |
562 struct df_insn_info **insns; /* Insn table, indexed by insn UID. */ | 543 struct df_insn_info **insns; /* Insn table, indexed by insn UID. */ |
563 unsigned int insns_size; /* Size of insn table. */ | 544 unsigned int insns_size; /* Size of insn table. */ |
564 | 545 |
565 int num_problems_defined; | 546 int num_problems_defined; |
566 | 547 |
567 bitmap hardware_regs_used; /* The set of hardware registers used. */ | 548 bitmap_head hardware_regs_used; /* The set of hardware registers used. */ |
568 /* The set of hard regs that are in the artificial uses at the end | 549 /* The set of hard regs that are in the artificial uses at the end |
569 of a regular basic block. */ | 550 of a regular basic block. */ |
570 bitmap regular_block_artificial_uses; | 551 bitmap_head regular_block_artificial_uses; |
571 /* The set of hard regs that are in the artificial uses at the end | 552 /* The set of hard regs that are in the artificial uses at the end |
572 of a basic block that has an EH pred. */ | 553 of a basic block that has an EH pred. */ |
573 bitmap eh_block_artificial_uses; | 554 bitmap_head eh_block_artificial_uses; |
574 /* The set of hardware registers live on entry to the function. */ | 555 /* The set of hardware registers live on entry to the function. */ |
575 bitmap entry_block_defs; | 556 bitmap entry_block_defs; |
576 bitmap exit_block_uses; /* The set of hardware registers used in exit block. */ | 557 bitmap exit_block_uses; /* The set of hardware registers used in exit block. */ |
577 | 558 |
578 /* Insns to delete, rescan or reprocess the notes at next | 559 /* Insns to delete, rescan or reprocess the notes at next |
579 df_rescan_all or df_process_deferred_rescans. */ | 560 df_rescan_all or df_process_deferred_rescans. */ |
580 bitmap insns_to_delete; | 561 bitmap_head insns_to_delete; |
581 bitmap insns_to_rescan; | 562 bitmap_head insns_to_rescan; |
582 bitmap insns_to_notes_rescan; | 563 bitmap_head insns_to_notes_rescan; |
583 int *postorder; /* The current set of basic blocks | 564 int *postorder; /* The current set of basic blocks |
584 in reverse postorder. */ | 565 in reverse postorder. */ |
585 int *postorder_inverted; /* The current set of basic blocks | 566 int *postorder_inverted; /* The current set of basic blocks |
586 in reverse postorder of inverted CFG. */ | 567 in reverse postorder of inverted CFG. */ |
587 int n_blocks; /* The number of blocks in reverse postorder. */ | 568 int n_blocks; /* The number of blocks in reverse postorder. */ |
619 | 600 |
620 #define DF_SCAN_BB_INFO(BB) (df_scan_get_bb_info((BB)->index)) | 601 #define DF_SCAN_BB_INFO(BB) (df_scan_get_bb_info((BB)->index)) |
621 #define DF_RD_BB_INFO(BB) (df_rd_get_bb_info((BB)->index)) | 602 #define DF_RD_BB_INFO(BB) (df_rd_get_bb_info((BB)->index)) |
622 #define DF_LR_BB_INFO(BB) (df_lr_get_bb_info((BB)->index)) | 603 #define DF_LR_BB_INFO(BB) (df_lr_get_bb_info((BB)->index)) |
623 #define DF_LIVE_BB_INFO(BB) (df_live_get_bb_info((BB)->index)) | 604 #define DF_LIVE_BB_INFO(BB) (df_live_get_bb_info((BB)->index)) |
624 #define DF_BYTE_LR_BB_INFO(BB) (df_byte_lr_get_bb_info((BB)->index)) | 605 #define DF_WORD_LR_BB_INFO(BB) (df_word_lr_get_bb_info((BB)->index)) |
625 #define DF_MD_BB_INFO(BB) (df_md_get_bb_info((BB)->index)) | 606 #define DF_MD_BB_INFO(BB) (df_md_get_bb_info((BB)->index)) |
626 | 607 |
627 /* Most transformations that wish to use live register analysis will | 608 /* Most transformations that wish to use live register analysis will |
628 use these macros. This info is the and of the lr and live sets. */ | 609 use these macros. This info is the and of the lr and live sets. */ |
629 #define DF_LIVE_IN(BB) (DF_LIVE_BB_INFO(BB)->in) | 610 #define DF_LIVE_IN(BB) (&DF_LIVE_BB_INFO(BB)->in) |
630 #define DF_LIVE_OUT(BB) (DF_LIVE_BB_INFO(BB)->out) | 611 #define DF_LIVE_OUT(BB) (&DF_LIVE_BB_INFO(BB)->out) |
631 | 612 |
632 /* These macros are used by passes that are not tolerant of | 613 /* These macros are used by passes that are not tolerant of |
633 uninitialized variables. This intolerance should eventually | 614 uninitialized variables. This intolerance should eventually |
634 be fixed. */ | 615 be fixed. */ |
635 #define DF_LR_IN(BB) (DF_LR_BB_INFO(BB)->in) | 616 #define DF_LR_IN(BB) (&DF_LR_BB_INFO(BB)->in) |
636 #define DF_LR_OUT(BB) (DF_LR_BB_INFO(BB)->out) | 617 #define DF_LR_OUT(BB) (&DF_LR_BB_INFO(BB)->out) |
637 | 618 |
638 /* These macros are used by passes that are not tolerant of | 619 /* These macros are used by passes that are not tolerant of |
639 uninitialized variables. This intolerance should eventually | 620 uninitialized variables. This intolerance should eventually |
640 be fixed. */ | 621 be fixed. */ |
641 #define DF_BYTE_LR_IN(BB) (DF_BYTE_LR_BB_INFO(BB)->in) | 622 #define DF_WORD_LR_IN(BB) (&DF_WORD_LR_BB_INFO(BB)->in) |
642 #define DF_BYTE_LR_OUT(BB) (DF_BYTE_LR_BB_INFO(BB)->out) | 623 #define DF_WORD_LR_OUT(BB) (&DF_WORD_LR_BB_INFO(BB)->out) |
643 | 624 |
644 /* Macros to access the elements within the ref structure. */ | 625 /* Macros to access the elements within the ref structure. */ |
645 | 626 |
646 | 627 |
647 #define DF_REF_REAL_REG(REF) (GET_CODE ((REF)->base.reg) == SUBREG \ | 628 #define DF_REF_REAL_REG(REF) (GET_CODE ((REF)->base.reg) == SUBREG \ |
648 ? SUBREG_REG ((REF)->base.reg) : ((REF)->base.reg)) | 629 ? SUBREG_REG ((REF)->base.reg) : ((REF)->base.reg)) |
649 #define DF_REF_REGNO(REF) ((REF)->base.regno) | 630 #define DF_REF_REGNO(REF) ((REF)->base.regno) |
650 #define DF_REF_REAL_LOC(REF) (GET_CODE (*((REF)->regular_ref.loc)) == SUBREG \ | 631 #define DF_REF_REAL_LOC(REF) (GET_CODE (*((REF)->regular_ref.loc)) == SUBREG \ |
651 ? &SUBREG_REG (*((REF)->regular_ref.loc)) : ((REF)->regular_ref.loc)) | 632 ? &SUBREG_REG (*((REF)->regular_ref.loc)) : ((REF)->regular_ref.loc)) |
652 #define DF_REF_REG(REF) ((REF)->base.reg) | 633 #define DF_REF_REG(REF) ((REF)->base.reg) |
653 #define DF_REF_LOC(REF) ((DF_REF_CLASS(REF) == DF_REF_REGULAR || DF_REF_CLASS(REF) == DF_REF_EXTRACT) ? \ | 634 #define DF_REF_LOC(REF) (DF_REF_CLASS(REF) == DF_REF_REGULAR ? \ |
654 (REF)->regular_ref.loc : NULL) | 635 (REF)->regular_ref.loc : NULL) |
655 #define DF_REF_BB(REF) (DF_REF_IS_ARTIFICIAL(REF) ? \ | 636 #define DF_REF_BB(REF) (DF_REF_IS_ARTIFICIAL(REF) ? \ |
656 (REF)->artificial_ref.bb : BLOCK_FOR_INSN (DF_REF_INSN(REF))) | 637 (REF)->artificial_ref.bb : BLOCK_FOR_INSN (DF_REF_INSN(REF))) |
657 #define DF_REF_BBNO(REF) (DF_REF_BB (REF)->index) | 638 #define DF_REF_BBNO(REF) (DF_REF_BB (REF)->index) |
658 #define DF_REF_INSN_INFO(REF) ((REF)->base.insn_info) | 639 #define DF_REF_INSN_INFO(REF) ((REF)->base.insn_info) |
794 /* Reaching definitions. All bitmaps are indexed by the id field of | 775 /* Reaching definitions. All bitmaps are indexed by the id field of |
795 the ref except sparse_kill which is indexed by regno. */ | 776 the ref except sparse_kill which is indexed by regno. */ |
796 struct df_rd_bb_info | 777 struct df_rd_bb_info |
797 { | 778 { |
798 /* Local sets to describe the basic blocks. */ | 779 /* Local sets to describe the basic blocks. */ |
799 bitmap kill; | 780 bitmap_head kill; |
800 bitmap sparse_kill; | 781 bitmap_head sparse_kill; |
801 bitmap gen; /* The set of defs generated in this block. */ | 782 bitmap_head gen; /* The set of defs generated in this block. */ |
802 | 783 |
803 /* The results of the dataflow problem. */ | 784 /* The results of the dataflow problem. */ |
804 bitmap in; /* At the top of the block. */ | 785 bitmap_head in; /* At the top of the block. */ |
805 bitmap out; /* At the bottom of the block. */ | 786 bitmap_head out; /* At the bottom of the block. */ |
806 }; | 787 }; |
807 | 788 |
808 | 789 |
809 /* Multiple reaching definitions. All bitmaps are referenced by the | 790 /* Multiple reaching definitions. All bitmaps are referenced by the |
810 register number. */ | 791 register number. */ |
811 | 792 |
812 struct df_md_bb_info | 793 struct df_md_bb_info |
813 { | 794 { |
814 /* Local sets to describe the basic blocks. */ | 795 /* Local sets to describe the basic blocks. */ |
815 bitmap gen; /* Partial/conditional definitions live at BB out. */ | 796 bitmap_head gen; /* Partial/conditional definitions live at BB out. */ |
816 bitmap kill; /* Other definitions that are live at BB out. */ | 797 bitmap_head kill; /* Other definitions that are live at BB out. */ |
817 bitmap init; /* Definitions coming from dominance frontier edges. */ | 798 bitmap_head init; /* Definitions coming from dominance frontier edges. */ |
818 | 799 |
819 /* The results of the dataflow problem. */ | 800 /* The results of the dataflow problem. */ |
820 bitmap in; /* Just before the block itself. */ | 801 bitmap_head in; /* Just before the block itself. */ |
821 bitmap out; /* At the bottom of the block. */ | 802 bitmap_head out; /* At the bottom of the block. */ |
822 }; | 803 }; |
823 | 804 |
824 | 805 |
825 /* Live registers, a backwards dataflow problem. All bitmaps are | 806 /* Live registers, a backwards dataflow problem. All bitmaps are |
826 referenced by the register number. */ | 807 referenced by the register number. */ |
827 | 808 |
828 struct df_lr_bb_info | 809 struct df_lr_bb_info |
829 { | 810 { |
830 /* Local sets to describe the basic blocks. */ | 811 /* Local sets to describe the basic blocks. */ |
831 bitmap def; /* The set of registers set in this block | 812 bitmap_head def; /* The set of registers set in this block |
832 - except artificial defs at the top. */ | 813 - except artificial defs at the top. */ |
833 bitmap use; /* The set of registers used in this block. */ | 814 bitmap_head use; /* The set of registers used in this block. */ |
834 | 815 |
835 /* The results of the dataflow problem. */ | 816 /* The results of the dataflow problem. */ |
836 bitmap in; /* Just before the block itself. */ | 817 bitmap_head in; /* Just before the block itself. */ |
837 bitmap out; /* At the bottom of the block. */ | 818 bitmap_head out; /* At the bottom of the block. */ |
838 }; | 819 }; |
839 | 820 |
840 | 821 |
841 /* Uninitialized registers. All bitmaps are referenced by the | 822 /* Uninitialized registers. All bitmaps are referenced by the |
842 register number. Anded results of the forwards and backward live | 823 register number. Anded results of the forwards and backward live |
843 info. Note that the forwards live information is not available | 824 info. Note that the forwards live information is not available |
844 separately. */ | 825 separately. */ |
845 struct df_live_bb_info | 826 struct df_live_bb_info |
846 { | 827 { |
847 /* Local sets to describe the basic blocks. */ | 828 /* Local sets to describe the basic blocks. */ |
848 bitmap kill; /* The set of registers unset in this block. Calls, | 829 bitmap_head kill; /* The set of registers unset in this block. Calls, |
849 for instance, unset registers. */ | 830 for instance, unset registers. */ |
850 bitmap gen; /* The set of registers set in this block. */ | 831 bitmap_head gen; /* The set of registers set in this block. */ |
851 | 832 |
852 /* The results of the dataflow problem. */ | 833 /* The results of the dataflow problem. */ |
853 bitmap in; /* At the top of the block. */ | 834 bitmap_head in; /* At the top of the block. */ |
854 bitmap out; /* At the bottom of the block. */ | 835 bitmap_head out; /* At the bottom of the block. */ |
855 }; | 836 }; |
856 | 837 |
857 | 838 |
858 /* Live registers, a backwards dataflow problem. These bitmaps are | 839 /* Live registers, a backwards dataflow problem. These bitmaps are |
859 indexed by the df_byte_lr_offset array which is indexed by pseudo. */ | 840 indexed by 2 * regno for each pseudo and have two entries for each |
860 | 841 pseudo. Only pseudos that have a size of 2 * UNITS_PER_WORD are |
861 struct df_byte_lr_bb_info | 842 meaningfully tracked. */ |
843 | |
844 struct df_word_lr_bb_info | |
862 { | 845 { |
863 /* Local sets to describe the basic blocks. */ | 846 /* Local sets to describe the basic blocks. */ |
864 bitmap def; /* The set of registers set in this block | 847 bitmap_head def; /* The set of registers set in this block |
865 - except artificial defs at the top. */ | 848 - except artificial defs at the top. */ |
866 bitmap use; /* The set of registers used in this block. */ | 849 bitmap_head use; /* The set of registers used in this block. */ |
867 | 850 |
868 /* The results of the dataflow problem. */ | 851 /* The results of the dataflow problem. */ |
869 bitmap in; /* Just before the block itself. */ | 852 bitmap_head in; /* Just before the block itself. */ |
870 bitmap out; /* At the bottom of the block. */ | 853 bitmap_head out; /* At the bottom of the block. */ |
871 }; | 854 }; |
872 | 855 |
873 | 856 |
874 /* This is used for debugging and for the dumpers to find the latest | 857 /* This is used for debugging and for the dumpers to find the latest |
875 instance so that the df info can be added to the dumps. This | 858 instance so that the df info can be added to the dumps. This |
876 should not be used by regular code. */ | 859 should not be used by regular code. */ |
877 extern struct df *df; | 860 extern struct df_d *df; |
878 #define df_scan (df->problems_by_index[DF_SCAN]) | 861 #define df_scan (df->problems_by_index[DF_SCAN]) |
879 #define df_rd (df->problems_by_index[DF_RD]) | 862 #define df_rd (df->problems_by_index[DF_RD]) |
880 #define df_lr (df->problems_by_index[DF_LR]) | 863 #define df_lr (df->problems_by_index[DF_LR]) |
881 #define df_live (df->problems_by_index[DF_LIVE]) | 864 #define df_live (df->problems_by_index[DF_LIVE]) |
882 #define df_chain (df->problems_by_index[DF_CHAIN]) | 865 #define df_chain (df->problems_by_index[DF_CHAIN]) |
883 #define df_byte_lr (df->problems_by_index[DF_BYTE_LR]) | 866 #define df_word_lr (df->problems_by_index[DF_WORD_LR]) |
884 #define df_note (df->problems_by_index[DF_NOTE]) | 867 #define df_note (df->problems_by_index[DF_NOTE]) |
885 #define df_md (df->problems_by_index[DF_MD]) | 868 #define df_md (df->problems_by_index[DF_MD]) |
886 | 869 |
887 /* This symbol turns on checking that each modification of the cfg has | 870 /* This symbol turns on checking that each modification of the cfg has |
888 been identified to the appropriate df routines. It is not part of | 871 been identified to the appropriate df routines. It is not part of |
912 df_confluence_function_0, df_confluence_function_n, | 895 df_confluence_function_0, df_confluence_function_n, |
913 df_transfer_function, bitmap, int *, int); | 896 df_transfer_function, bitmap, int *, int); |
914 extern void df_mark_solutions_dirty (void); | 897 extern void df_mark_solutions_dirty (void); |
915 extern bool df_get_bb_dirty (basic_block); | 898 extern bool df_get_bb_dirty (basic_block); |
916 extern void df_set_bb_dirty (basic_block); | 899 extern void df_set_bb_dirty (basic_block); |
917 extern void df_set_bb_dirty_nonlr (basic_block); | |
918 extern void df_compact_blocks (void); | 900 extern void df_compact_blocks (void); |
919 extern void df_bb_replace (int, basic_block); | 901 extern void df_bb_replace (int, basic_block); |
920 extern void df_bb_delete (int); | 902 extern void df_bb_delete (int); |
921 extern void df_verify (void); | 903 extern void df_verify (void); |
922 #ifdef DF_DEBUG_CFG | 904 #ifdef DF_DEBUG_CFG |
928 extern bool df_reg_defined (rtx, rtx); | 910 extern bool df_reg_defined (rtx, rtx); |
929 extern df_ref df_find_use (rtx, rtx); | 911 extern df_ref df_find_use (rtx, rtx); |
930 extern bool df_reg_used (rtx, rtx); | 912 extern bool df_reg_used (rtx, rtx); |
931 extern void df_worklist_dataflow (struct dataflow *,bitmap, int *, int); | 913 extern void df_worklist_dataflow (struct dataflow *,bitmap, int *, int); |
932 extern void df_print_regset (FILE *file, bitmap r); | 914 extern void df_print_regset (FILE *file, bitmap r); |
933 extern void df_print_byte_regset (FILE *file, bitmap r); | 915 extern void df_print_word_regset (FILE *file, bitmap r); |
934 extern void df_dump (FILE *); | 916 extern void df_dump (FILE *); |
935 extern void df_dump_region (FILE *); | 917 extern void df_dump_region (FILE *); |
936 extern void df_dump_start (FILE *); | 918 extern void df_dump_start (FILE *); |
937 extern void df_dump_top (basic_block, FILE *); | 919 extern void df_dump_top (basic_block, FILE *); |
938 extern void df_dump_bottom (basic_block, FILE *); | 920 extern void df_dump_bottom (basic_block, FILE *); |
967 extern void df_lr_verify_transfer_functions (void); | 949 extern void df_lr_verify_transfer_functions (void); |
968 extern void df_live_verify_transfer_functions (void); | 950 extern void df_live_verify_transfer_functions (void); |
969 extern void df_live_add_problem (void); | 951 extern void df_live_add_problem (void); |
970 extern void df_live_set_all_dirty (void); | 952 extern void df_live_set_all_dirty (void); |
971 extern void df_chain_add_problem (unsigned int); | 953 extern void df_chain_add_problem (unsigned int); |
972 extern void df_byte_lr_add_problem (void); | 954 extern void df_word_lr_add_problem (void); |
973 extern int df_byte_lr_get_regno_start (unsigned int); | 955 extern bool df_word_lr_mark_ref (df_ref, bool, bitmap); |
974 extern int df_byte_lr_get_regno_len (unsigned int); | 956 extern bool df_word_lr_simulate_defs (rtx, bitmap); |
975 extern void df_byte_lr_simulate_defs (rtx, bitmap); | 957 extern void df_word_lr_simulate_uses (rtx, bitmap); |
976 extern void df_byte_lr_simulate_uses (rtx, bitmap); | 958 extern void df_word_lr_simulate_artificial_refs_at_top (basic_block, bitmap); |
977 extern void df_byte_lr_simulate_artificial_refs_at_top (basic_block, bitmap); | 959 extern void df_word_lr_simulate_artificial_refs_at_end (basic_block, bitmap); |
978 extern void df_byte_lr_simulate_artificial_refs_at_end (basic_block, bitmap); | |
979 extern void df_note_add_problem (void); | 960 extern void df_note_add_problem (void); |
980 extern void df_md_add_problem (void); | 961 extern void df_md_add_problem (void); |
981 extern void df_md_simulate_artificial_defs_at_top (basic_block, bitmap); | 962 extern void df_md_simulate_artificial_defs_at_top (basic_block, bitmap); |
982 extern void df_md_simulate_one_insn (basic_block, rtx, bitmap); | 963 extern void df_md_simulate_one_insn (basic_block, rtx, bitmap); |
983 extern void df_simulate_find_noclobber_defs (rtx, bitmap); | 964 extern void df_simulate_find_noclobber_defs (rtx, bitmap); |
987 extern void df_simulate_initialize_backwards (basic_block, bitmap); | 968 extern void df_simulate_initialize_backwards (basic_block, bitmap); |
988 extern void df_simulate_one_insn_backwards (basic_block, rtx, bitmap); | 969 extern void df_simulate_one_insn_backwards (basic_block, rtx, bitmap); |
989 extern void df_simulate_finalize_backwards (basic_block, bitmap); | 970 extern void df_simulate_finalize_backwards (basic_block, bitmap); |
990 extern void df_simulate_initialize_forwards (basic_block, bitmap); | 971 extern void df_simulate_initialize_forwards (basic_block, bitmap); |
991 extern void df_simulate_one_insn_forwards (basic_block, rtx, bitmap); | 972 extern void df_simulate_one_insn_forwards (basic_block, rtx, bitmap); |
992 | 973 extern void simulate_backwards_to_point (basic_block, regset, rtx); |
974 extern bool can_move_insns_across (rtx, rtx, rtx, rtx, basic_block, regset, | |
975 regset, rtx *); | |
993 /* Functions defined in df-scan.c. */ | 976 /* Functions defined in df-scan.c. */ |
994 | 977 |
995 extern void df_scan_alloc (bitmap); | 978 extern void df_scan_alloc (bitmap); |
996 extern void df_scan_add_problem (void); | 979 extern void df_scan_add_problem (void); |
997 extern void df_grow_reg_info (void); | 980 extern void df_grow_reg_info (void); |
998 extern void df_grow_insn_info (void); | 981 extern void df_grow_insn_info (void); |
999 extern void df_scan_blocks (void); | 982 extern void df_scan_blocks (void); |
1000 extern df_ref df_ref_create (rtx, rtx *, rtx,basic_block, | 983 extern df_ref df_ref_create (rtx, rtx *, rtx,basic_block, |
1001 enum df_ref_type, int ref_flags, | 984 enum df_ref_type, int ref_flags); |
1002 int, int, enum machine_mode); | 985 extern void df_uses_create (rtx *, rtx, int); |
1003 extern void df_ref_remove (df_ref); | 986 extern void df_ref_remove (df_ref); |
1004 extern struct df_insn_info * df_insn_create_insn_record (rtx); | 987 extern struct df_insn_info * df_insn_create_insn_record (rtx); |
1005 extern void df_insn_delete (basic_block, unsigned int); | 988 extern void df_insn_delete (basic_block, unsigned int); |
1006 extern void df_bb_refs_record (int, bool); | 989 extern void df_bb_refs_record (int, bool); |
1007 extern bool df_insn_rescan (rtx); | 990 extern bool df_insn_rescan (rtx); |
1024 extern void df_set_regs_ever_live (unsigned int, bool); | 1007 extern void df_set_regs_ever_live (unsigned int, bool); |
1025 extern void df_compute_regs_ever_live (bool); | 1008 extern void df_compute_regs_ever_live (bool); |
1026 extern bool df_read_modify_subreg_p (rtx); | 1009 extern bool df_read_modify_subreg_p (rtx); |
1027 extern void df_scan_verify (void); | 1010 extern void df_scan_verify (void); |
1028 | 1011 |
1029 /* Functions defined in df-byte-scan.c. */ | |
1030 extern bool df_compute_accessed_bytes (df_ref, enum df_mm, | |
1031 unsigned int *, unsigned int *); | |
1032 | |
1033 | |
1034 /* Get basic block info. */ | 1012 /* Get basic block info. */ |
1035 | 1013 |
1036 static inline struct df_scan_bb_info * | 1014 static inline struct df_scan_bb_info * |
1037 df_scan_get_bb_info (unsigned int index) | 1015 df_scan_get_bb_info (unsigned int index) |
1038 { | 1016 { |
1039 if (index < df_scan->block_info_size) | 1017 if (index < df_scan->block_info_size) |
1040 return (struct df_scan_bb_info *) df_scan->block_info[index]; | 1018 return &((struct df_scan_bb_info *) df_scan->block_info)[index]; |
1041 else | 1019 else |
1042 return NULL; | 1020 return NULL; |
1043 } | 1021 } |
1044 | 1022 |
1045 static inline struct df_rd_bb_info * | 1023 static inline struct df_rd_bb_info * |
1046 df_rd_get_bb_info (unsigned int index) | 1024 df_rd_get_bb_info (unsigned int index) |
1047 { | 1025 { |
1048 if (index < df_rd->block_info_size) | 1026 if (index < df_rd->block_info_size) |
1049 return (struct df_rd_bb_info *) df_rd->block_info[index]; | 1027 return &((struct df_rd_bb_info *) df_rd->block_info)[index]; |
1050 else | 1028 else |
1051 return NULL; | 1029 return NULL; |
1052 } | 1030 } |
1053 | 1031 |
1054 static inline struct df_lr_bb_info * | 1032 static inline struct df_lr_bb_info * |
1055 df_lr_get_bb_info (unsigned int index) | 1033 df_lr_get_bb_info (unsigned int index) |
1056 { | 1034 { |
1057 if (index < df_lr->block_info_size) | 1035 if (index < df_lr->block_info_size) |
1058 return (struct df_lr_bb_info *) df_lr->block_info[index]; | 1036 return &((struct df_lr_bb_info *) df_lr->block_info)[index]; |
1059 else | 1037 else |
1060 return NULL; | 1038 return NULL; |
1061 } | 1039 } |
1062 | 1040 |
1063 static inline struct df_md_bb_info * | 1041 static inline struct df_md_bb_info * |
1064 df_md_get_bb_info (unsigned int index) | 1042 df_md_get_bb_info (unsigned int index) |
1065 { | 1043 { |
1066 if (index < df_md->block_info_size) | 1044 if (index < df_md->block_info_size) |
1067 return (struct df_md_bb_info *) df_md->block_info[index]; | 1045 return &((struct df_md_bb_info *) df_md->block_info)[index]; |
1068 else | 1046 else |
1069 return NULL; | 1047 return NULL; |
1070 } | 1048 } |
1071 | 1049 |
1072 static inline struct df_live_bb_info * | 1050 static inline struct df_live_bb_info * |
1073 df_live_get_bb_info (unsigned int index) | 1051 df_live_get_bb_info (unsigned int index) |
1074 { | 1052 { |
1075 if (index < df_live->block_info_size) | 1053 if (index < df_live->block_info_size) |
1076 return (struct df_live_bb_info *) df_live->block_info[index]; | 1054 return &((struct df_live_bb_info *) df_live->block_info)[index]; |
1077 else | 1055 else |
1078 return NULL; | 1056 return NULL; |
1079 } | 1057 } |
1080 | 1058 |
1081 static inline struct df_byte_lr_bb_info * | 1059 static inline struct df_word_lr_bb_info * |
1082 df_byte_lr_get_bb_info (unsigned int index) | 1060 df_word_lr_get_bb_info (unsigned int index) |
1083 { | 1061 { |
1084 if (index < df_byte_lr->block_info_size) | 1062 if (index < df_word_lr->block_info_size) |
1085 return (struct df_byte_lr_bb_info *) df_byte_lr->block_info[index]; | 1063 return &((struct df_word_lr_bb_info *) df_word_lr->block_info)[index]; |
1086 else | 1064 else |
1087 return NULL; | 1065 return NULL; |
1088 } | 1066 } |
1089 | 1067 |
1090 /* Get the artificial defs for a basic block. */ | 1068 /* Get the artificial defs for a basic block. */ |