aboutsummaryrefslogtreecommitdiff
path: root/gcc/bitmap.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-11-12 15:05:03 +0100
committerRichard Biener <rguenther@suse.de>2020-11-12 15:08:43 +0100
commit896db49a442a15a1fa1f641cd0385da1ba1794e3 (patch)
treefbbdbc6276cb75d899d8eefbefbd25ec59a48166 /gcc/bitmap.c
parentcb808c583de59ea568fd240144cd9db07272f45e (diff)
downloadgcc-896db49a442a15a1fa1f641cd0385da1ba1794e3.zip
gcc-896db49a442a15a1fa1f641cd0385da1ba1794e3.tar.gz
gcc-896db49a442a15a1fa1f641cd0385da1ba1794e3.tar.bz2
More PRE compile-time optimizations
This fixes a bug in bitmap_list_view which could end up with a NULL head->current which makes followup searches fail. Oops. It also further optimizes the PRE DFS walk by removing useless stuff and special-casing bitmaps with just one element for EXECUTE_IF_AND_IN_BITMAP which makes a quite big difference. 2020-11-12 Richard Biener <rguenther@suse.de> * bitmap.c (bitmap_list_view): Restore head->current. * tree-ssa-pre.c (pre_expr_DFS): Elide expr_visited bitmap. Special-case value expression bitmaps with one element. (bitmap_find_leader): Likewise. (sorted_array_from_bitmap_set): Elide expr_visited bitmap.
Diffstat (limited to 'gcc/bitmap.c')
-rw-r--r--gcc/bitmap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index 810b80b..c849b0d 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -678,6 +678,11 @@ bitmap_list_view (bitmap head)
}
head->tree_form = false;
+ if (!head->current)
+ {
+ head->current = head->first;
+ head->indx = head->current ? head->current->indx : 0;
+ }
}
/* Convert bitmap HEAD from linked-list view to splay-tree view.