Commit 9bf7cffd authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Reduce worst time complexity of mem parallelisation from O(2**n) to O(n**2).

[r20791]
parent 7d3bd5aa
...@@ -628,6 +628,10 @@ typedef struct parallelise_info ...@@ -628,6 +628,10 @@ typedef struct parallelise_info
static void parallelise_load(parallelise_info *pi, ir_node *irn) static void parallelise_load(parallelise_info *pi, ir_node *irn)
{ {
/* There is no point in investigating the same subgraph twice */
if (ir_nodeset_contains(&pi->user_mem, irn))
return;
//ir_fprintf(stderr, "considering %+F\n", irn); //ir_fprintf(stderr, "considering %+F\n", irn);
if (get_nodes_block(irn) == pi->origin_block) { if (get_nodes_block(irn) == pi->origin_block) {
if (is_Proj(irn)) { if (is_Proj(irn)) {
...@@ -673,6 +677,10 @@ static void parallelise_load(parallelise_info *pi, ir_node *irn) ...@@ -673,6 +677,10 @@ static void parallelise_load(parallelise_info *pi, ir_node *irn)
static void parallelise_store(parallelise_info *pi, ir_node *irn) static void parallelise_store(parallelise_info *pi, ir_node *irn)
{ {
/* There is no point in investigating the same subgraph twice */
if (ir_nodeset_contains(&pi->user_mem, irn))
return;
//ir_fprintf(stderr, "considering %+F\n", irn); //ir_fprintf(stderr, "considering %+F\n", irn);
if (get_nodes_block(irn) == pi->origin_block) { if (get_nodes_block(irn) == pi->origin_block) {
if (is_Proj(irn)) { if (is_Proj(irn)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment