Mercurial > hg > CbC > CbC_gcc
comparison gcc/ira-build.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* Building internal representation for IRA. | 1 /* Building internal representation for IRA. |
2 Copyright (C) 2006-2017 Free Software Foundation, Inc. | 2 Copyright (C) 2006-2018 Free Software Foundation, Inc. |
3 Contributed by Vladimir Makarov <vmakarov@redhat.com>. | 3 Contributed by Vladimir Makarov <vmakarov@redhat.com>. |
4 | 4 |
5 This file is part of GCC. | 5 This file is part of GCC. |
6 | 6 |
7 GCC is free software; you can redistribute it and/or modify it under | 7 GCC is free software; you can redistribute it and/or modify it under |
564 machine_mode mode = ALLOCNO_MODE (a); | 564 machine_mode mode = ALLOCNO_MODE (a); |
565 enum reg_class aclass = ALLOCNO_CLASS (a); | 565 enum reg_class aclass = ALLOCNO_CLASS (a); |
566 int n = ira_reg_class_max_nregs[aclass][mode]; | 566 int n = ira_reg_class_max_nregs[aclass][mode]; |
567 int i; | 567 int i; |
568 | 568 |
569 if (GET_MODE_SIZE (mode) != 2 * UNITS_PER_WORD || n != 2) | 569 if (n != 2 || maybe_ne (GET_MODE_SIZE (mode), n * UNITS_PER_WORD)) |
570 n = 1; | 570 n = 1; |
571 | 571 |
572 ALLOCNO_NUM_OBJECTS (a) = n; | 572 ALLOCNO_NUM_OBJECTS (a) = n; |
573 for (i = 0; i < n; i++) | 573 for (i = 0; i < n; i++) |
574 ALLOCNO_OBJECT (a, i) = ira_create_object (a, i); | 574 ALLOCNO_OBJECT (a, i) = ira_create_object (a, i); |
1874 else if (code == CLOBBER) | 1874 else if (code == CLOBBER) |
1875 { | 1875 { |
1876 create_insn_allocnos (XEXP (x, 0), NULL, true); | 1876 create_insn_allocnos (XEXP (x, 0), NULL, true); |
1877 return; | 1877 return; |
1878 } | 1878 } |
1879 else if (code == CLOBBER_HIGH) | |
1880 { | |
1881 gcc_assert (REG_P (XEXP (x, 0)) && HARD_REGISTER_P (XEXP (x, 0))); | |
1882 return; | |
1883 } | |
1879 else if (code == MEM) | 1884 else if (code == MEM) |
1880 { | 1885 { |
1881 create_insn_allocnos (XEXP (x, 0), NULL, false); | 1886 create_insn_allocnos (XEXP (x, 0), NULL, false); |
1882 return; | 1887 return; |
1883 } | 1888 } |
2200 ira_assert (l1->parent != NULL && l2->parent != NULL); | 2205 ira_assert (l1->parent != NULL && l2->parent != NULL); |
2201 if (l1->to_remove_p && ! l2->to_remove_p) | 2206 if (l1->to_remove_p && ! l2->to_remove_p) |
2202 return -1; | 2207 return -1; |
2203 if (! l1->to_remove_p && l2->to_remove_p) | 2208 if (! l1->to_remove_p && l2->to_remove_p) |
2204 return 1; | 2209 return 1; |
2205 if ((diff = l1->loop->header->frequency - l2->loop->header->frequency) != 0) | 2210 if ((diff = l1->loop->header->count.to_frequency (cfun) |
2211 - l2->loop->header->count.to_frequency (cfun)) != 0) | |
2206 return diff; | 2212 return diff; |
2207 if ((diff = (int) loop_depth (l1->loop) - (int) loop_depth (l2->loop)) != 0) | 2213 if ((diff = (int) loop_depth (l1->loop) - (int) loop_depth (l2->loop)) != 0) |
2208 return diff; | 2214 return diff; |
2209 /* Make sorting stable. */ | 2215 /* Make sorting stable. */ |
2210 return l1->loop_num - l2->loop_num; | 2216 return l1->loop_num - l2->loop_num; |
2258 if (internal_flag_ira_verbose > 1 && ira_dump_file != NULL) | 2264 if (internal_flag_ira_verbose > 1 && ira_dump_file != NULL) |
2259 fprintf | 2265 fprintf |
2260 (ira_dump_file, | 2266 (ira_dump_file, |
2261 " Mark loop %d (header %d, freq %d, depth %d) for removal (%s)\n", | 2267 " Mark loop %d (header %d, freq %d, depth %d) for removal (%s)\n", |
2262 sorted_loops[i]->loop_num, sorted_loops[i]->loop->header->index, | 2268 sorted_loops[i]->loop_num, sorted_loops[i]->loop->header->index, |
2263 sorted_loops[i]->loop->header->frequency, | 2269 sorted_loops[i]->loop->header->count.to_frequency (cfun), |
2264 loop_depth (sorted_loops[i]->loop), | 2270 loop_depth (sorted_loops[i]->loop), |
2265 low_pressure_loop_node_p (sorted_loops[i]->parent) | 2271 low_pressure_loop_node_p (sorted_loops[i]->parent) |
2266 && low_pressure_loop_node_p (sorted_loops[i]) | 2272 && low_pressure_loop_node_p (sorted_loops[i]) |
2267 ? "low pressure" : "cheap loop"); | 2273 ? "low pressure" : "cheap loop"); |
2268 } | 2274 } |
2291 fprintf | 2297 fprintf |
2292 (ira_dump_file, | 2298 (ira_dump_file, |
2293 " Mark loop %d (header %d, freq %d, depth %d) for removal\n", | 2299 " Mark loop %d (header %d, freq %d, depth %d) for removal\n", |
2294 ira_loop_nodes[i].loop_num, | 2300 ira_loop_nodes[i].loop_num, |
2295 ira_loop_nodes[i].loop->header->index, | 2301 ira_loop_nodes[i].loop->header->index, |
2296 ira_loop_nodes[i].loop->header->frequency, | 2302 ira_loop_nodes[i].loop->header->count.to_frequency (cfun), |
2297 loop_depth (ira_loop_nodes[i].loop)); | 2303 loop_depth (ira_loop_nodes[i].loop)); |
2298 } | 2304 } |
2299 } | 2305 } |
2300 | 2306 |
2301 /* Definition of vector of loop tree nodes. */ | 2307 /* Definition of vector of loop tree nodes. */ |
2725 { | 2731 { |
2726 ira_object_t obj = ALLOCNO_OBJECT (a, j); | 2732 ira_object_t obj = ALLOCNO_OBJECT (a, j); |
2727 ira_object_t parent_obj; | 2733 ira_object_t parent_obj; |
2728 | 2734 |
2729 if (OBJECT_MAX (obj) < 0) | 2735 if (OBJECT_MAX (obj) < 0) |
2730 continue; | 2736 { |
2737 /* The object is not used and hence does not live. */ | |
2738 ira_assert (OBJECT_LIVE_RANGES (obj) == NULL); | |
2739 OBJECT_MAX (obj) = 0; | |
2740 OBJECT_MIN (obj) = 1; | |
2741 continue; | |
2742 } | |
2731 ira_assert (ALLOCNO_CAP_MEMBER (a) == NULL); | 2743 ira_assert (ALLOCNO_CAP_MEMBER (a) == NULL); |
2732 /* Accumulation of range info. */ | 2744 /* Accumulation of range info. */ |
2733 if (ALLOCNO_CAP (a) != NULL) | 2745 if (ALLOCNO_CAP (a) != NULL) |
2734 { | 2746 { |
2735 for (cap = ALLOCNO_CAP (a); cap != NULL; cap = ALLOCNO_CAP (cap)) | 2747 for (cap = ALLOCNO_CAP (a); cap != NULL; cap = ALLOCNO_CAP (cap)) |
2753 } | 2765 } |
2754 } | 2766 } |
2755 #ifdef ENABLE_IRA_CHECKING | 2767 #ifdef ENABLE_IRA_CHECKING |
2756 FOR_EACH_OBJECT (obj, oi) | 2768 FOR_EACH_OBJECT (obj, oi) |
2757 { | 2769 { |
2758 if ((0 <= OBJECT_MIN (obj) && OBJECT_MIN (obj) <= ira_max_point) | 2770 if ((OBJECT_MIN (obj) >= 0 && OBJECT_MIN (obj) <= ira_max_point) |
2759 && (0 <= OBJECT_MAX (obj) && OBJECT_MAX (obj) <= ira_max_point)) | 2771 && (OBJECT_MAX (obj) >= 0 && OBJECT_MAX (obj) <= ira_max_point)) |
2760 continue; | 2772 continue; |
2761 gcc_unreachable (); | 2773 gcc_unreachable (); |
2762 } | 2774 } |
2763 #endif | 2775 #endif |
2764 } | 2776 } |