This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: patch to fix IRA degradation on SPEC2006 calculix
On Thu, Nov 20, 2008 at 09:36:48AM -0500, Vladimir Makarov wrote:
> The code (please see line marked by -->>) fixing the problem should be
> look like
>
> static void
> mark_loops_for_removal (void)
> {
> int i, n;
> ira_loop_tree_node_t *sorted_loops;
> loop_p loop;
>
> sorted_loops
> = (ira_loop_tree_node_t *) ira_allocate (sizeof (ira_loop_tree_node_t)
> * VEC_length (loop_p,
> ira_loops.larray));
> for (n = i = 0; VEC_iterate (loop_p, ira_loops.larray, i, loop); i++)
> -->>if (ira_loop_nodes[i].regno_allocno_map != NULL)
> {
> if (ira_loop_nodes[i].parent == NULL)
>
>
>
> Non-null regno_allocno_map means that the loop forms an allocation
> region and all members are defined.
>
> I have no bootstrap and c/c++ regression test failure with it. I am
> going to check the new version of the patch more thoroughly (more
> targets and full bootstrap) before submitting it.
>
Hi Vladimir,
I checked this into ira-merge branch.
Thanks.
H.J.
----
Index: ChangeLog.ira
===================================================================
--- ChangeLog.ira (revision 142044)
+++ ChangeLog.ira (working copy)
@@ -1,3 +1,9 @@
+2008-11-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ira-build.c (create_loop_tree_nodes): Revert the last change.
+ (mark_loops_for_removal): Check the regno_allocno_map field
+ before removing a loop node.
+
2008-11-19 H.J. Lu <hongjiu.lu@intel.com>
* ira-build.c (create_loop_tree_nodes): Always initialize the
Index: ira-build.c
===================================================================
--- ira-build.c (revision 142044)
+++ ira-build.c (working copy)
@@ -137,22 +137,18 @@ create_loop_tree_nodes (bool loops_p)
skip_p = true;
break;
}
- if (!skip_p)
- {
- edges = get_loop_exit_edges (loop);
- for (j = 0; VEC_iterate (edge, edges, j, e); j++)
- if ((e->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (e))
- {
- skip_p = true;
- break;
- }
- VEC_free (edge, heap, edges);
- }
if (skip_p)
- {
- ira_loop_nodes[i].parent = NULL;
- continue;
- }
+ continue;
+ edges = get_loop_exit_edges (loop);
+ for (j = 0; VEC_iterate (edge, edges, j, e); j++)
+ if ((e->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (e))
+ {
+ skip_p = true;
+ break;
+ }
+ VEC_free (edge, heap, edges);
+ if (skip_p)
+ continue;
}
ira_loop_nodes[i].regno_allocno_map
= (ira_allocno_t *) ira_allocate (sizeof (ira_allocno_t) * max_regno);
@@ -1724,18 +1720,19 @@ mark_loops_for_removal (void)
* VEC_length (loop_p,
ira_loops.larray));
for (n = i = 0; VEC_iterate (loop_p, ira_loops.larray, i, loop); i++)
- {
- if (ira_loop_nodes[i].parent == NULL)
- {
- /* Don't remove the root. */
- ira_loop_nodes[i].to_remove_p = false;
- continue;
- }
- sorted_loops[n++] = &ira_loop_nodes[i];
- ira_loop_nodes[i].to_remove_p
- = (low_pressure_loop_node_p (ira_loop_nodes[i].parent)
- && low_pressure_loop_node_p (&ira_loop_nodes[i]));
- }
+ if (ira_loop_nodes[i].regno_allocno_map != NULL)
+ {
+ if (ira_loop_nodes[i].parent == NULL)
+ {
+ /* Don't remove the root. */
+ ira_loop_nodes[i].to_remove_p = false;
+ continue;
+ }
+ sorted_loops[n++] = &ira_loop_nodes[i];
+ ira_loop_nodes[i].to_remove_p
+ = (low_pressure_loop_node_p (ira_loop_nodes[i].parent)
+ && low_pressure_loop_node_p (&ira_loop_nodes[i]));
+ }
qsort (sorted_loops, n, sizeof (ira_loop_tree_node_t), loop_compare_func);
for (i = 0; n - i + 1 > IRA_MAX_LOOPS_NUM; i++)
{