comparison gcc/df-core.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* Allocation for dataflow support routines. 1 /* Allocation for dataflow support routines.
2 Copyright (C) 1999-2018 Free Software Foundation, Inc. 2 Copyright (C) 1999-2020 Free Software Foundation, Inc.
3 Originally contributed by Michael P. Hayes 3 Originally contributed by Michael P. Hayes
4 (m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com) 4 (m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com)
5 Major rewrite contributed by Danny Berlin (dberlin@dberlin.org) 5 Major rewrite contributed by Danny Berlin (dberlin@dberlin.org)
6 and Kenneth Zadeck (zadeck@naturalbridge.com). 6 and Kenneth Zadeck (zadeck@naturalbridge.com).
7 7
296 these lists can be accessed by calling df_get_artificial_defs or 296 these lists can be accessed by calling df_get_artificial_defs or
297 df_get_artificial_uses for the particular basic block. 297 df_get_artificial_uses for the particular basic block.
298 298
299 Artificial defs and uses occur both at the beginning and ends of blocks. 299 Artificial defs and uses occur both at the beginning and ends of blocks.
300 300
301 For blocks that area at the destination of eh edges, the 301 For blocks that are at the destination of eh edges, the
302 artificial uses and defs occur at the beginning. The defs relate 302 artificial uses and defs occur at the beginning. The defs relate
303 to the registers specified in EH_RETURN_DATA_REGNO and the uses 303 to the registers specified in EH_RETURN_DATA_REGNO and the uses
304 relate to the registers specified in ED_USES. Logically these 304 relate to the registers specified in EH_USES. Logically these
305 defs and uses should really occur along the eh edge, but there is 305 defs and uses should really occur along the eh edge, but there is
306 no convenient way to do this. Artificial edges that occur at the 306 no convenient way to do this. Artificial defs that occur at the
307 beginning of the block have the DF_REF_AT_TOP flag set. 307 beginning of the block have the DF_REF_AT_TOP flag set.
308 308
309 Artificial uses occur at the end of all blocks. These arise from 309 Artificial uses occur at the end of all blocks. These arise from
310 the hard registers that are always live, such as the stack 310 the hard registers that are always live, such as the stack
311 register and are put there to keep the code from forgetting about 311 register and are put there to keep the code from forgetting about
405 405
406 /*---------------------------------------------------------------------------- 406 /*----------------------------------------------------------------------------
407 Functions to create, destroy and manipulate an instance of df. 407 Functions to create, destroy and manipulate an instance of df.
408 ----------------------------------------------------------------------------*/ 408 ----------------------------------------------------------------------------*/
409 409
410 struct df_d *df; 410 class df_d *df;
411 411
412 /* Add PROBLEM (and any dependent problems) to the DF instance. */ 412 /* Add PROBLEM (and any dependent problems) to the DF instance. */
413 413
414 void 414 void
415 df_add_problem (const struct df_problem *problem) 415 df_add_problem (const struct df_problem *problem)
682 682
683 static unsigned int 683 static unsigned int
684 rest_of_handle_df_initialize (void) 684 rest_of_handle_df_initialize (void)
685 { 685 {
686 gcc_assert (!df); 686 gcc_assert (!df);
687 df = XCNEW (struct df_d); 687 df = XCNEW (class df_d);
688 df->changeable_flags = 0; 688 df->changeable_flags = 0;
689 689
690 bitmap_obstack_initialize (&df_bitmap_obstack); 690 bitmap_obstack_initialize (&df_bitmap_obstack);
691 691
692 /* Set this to a conservative value. Stack_ptr_mod will compute it 692 /* Set this to a conservative value. Stack_ptr_mod will compute it
1291 1291
1292 /* Compute the reverse top sort order of the sub-CFG specified by LOOP. 1292 /* Compute the reverse top sort order of the sub-CFG specified by LOOP.
1293 Returns the number of blocks which is always loop->num_nodes. */ 1293 Returns the number of blocks which is always loop->num_nodes. */
1294 1294
1295 static int 1295 static int
1296 loop_post_order_compute (int *post_order, struct loop *loop) 1296 loop_post_order_compute (int *post_order, class loop *loop)
1297 { 1297 {
1298 edge_iterator *stack; 1298 edge_iterator *stack;
1299 int sp; 1299 int sp;
1300 int post_order_num = 0; 1300 int post_order_num = 0;
1301 1301
1352 1352
1353 /* Compute the reverse top sort order of the inverted sub-CFG specified 1353 /* Compute the reverse top sort order of the inverted sub-CFG specified
1354 by LOOP. Returns the number of blocks which is always loop->num_nodes. */ 1354 by LOOP. Returns the number of blocks which is always loop->num_nodes. */
1355 1355
1356 static void 1356 static void
1357 loop_inverted_post_order_compute (vec<int> *post_order, struct loop *loop) 1357 loop_inverted_post_order_compute (vec<int> *post_order, class loop *loop)
1358 { 1358 {
1359 basic_block bb; 1359 basic_block bb;
1360 edge_iterator *stack; 1360 edge_iterator *stack;
1361 int sp; 1361 int sp;
1362 1362
1417 1417
1418 1418
1419 /* Analyze dataflow info for the basic blocks contained in LOOP. */ 1419 /* Analyze dataflow info for the basic blocks contained in LOOP. */
1420 1420
1421 void 1421 void
1422 df_analyze_loop (struct loop *loop) 1422 df_analyze_loop (class loop *loop)
1423 { 1423 {
1424 free (df->postorder); 1424 free (df->postorder);
1425 1425
1426 df->postorder = XNEWVEC (int, loop->num_nodes); 1426 df->postorder = XNEWVEC (int, loop->num_nodes);
1427 df->postorder_inverted.truncate (0); 1427 df->postorder_inverted.truncate (0);
2050 2050
2051 /* Write information about registers and basic blocks into FILE. 2051 /* Write information about registers and basic blocks into FILE.
2052 This is part of making a debugging dump. */ 2052 This is part of making a debugging dump. */
2053 2053
2054 void 2054 void
2055 df_print_regset (FILE *file, bitmap r) 2055 df_print_regset (FILE *file, const_bitmap r)
2056 { 2056 {
2057 unsigned int i; 2057 unsigned int i;
2058 bitmap_iterator bi; 2058 bitmap_iterator bi;
2059 2059
2060 if (r == NULL) 2060 if (r == NULL)
2075 /* Write information about registers and basic blocks into FILE. The 2075 /* Write information about registers and basic blocks into FILE. The
2076 bitmap is in the form used by df_byte_lr. This is part of making a 2076 bitmap is in the form used by df_byte_lr. This is part of making a
2077 debugging dump. */ 2077 debugging dump. */
2078 2078
2079 void 2079 void
2080 df_print_word_regset (FILE *file, bitmap r) 2080 df_print_word_regset (FILE *file, const_bitmap r)
2081 { 2081 {
2082 unsigned int max_reg = max_reg_num (); 2082 unsigned int max_reg = max_reg_num ();
2083 2083
2084 if (r == NULL) 2084 if (r == NULL)
2085 fputs (" (nil)", file); 2085 fputs (" (nil)", file);