This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][1/2] Speedup PTA (PR38474)
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 9 Dec 2013 15:36:27 +0100 (CET)
- Subject: [PATCH][1/2] Speedup PTA (PR38474)
- Authentication-results: sourceware.org; auth=none
This is a first patch speeding up PTA for PR38474 (this patch not
so much for this particular testcase, but it should in general).
The reduced testcase now compiles in 197s for me (down from 207s).
Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
Richard.
2013-12-09 Richard Biener <rguenther@suse.de>
PR middle-end/38474
* tree-ssa-structalias.c (set_union_with_increment): Remove
unreachable code.
(do_complex_constraint): Call set_union_with_increment with
the solution delta, not the full solution.
(make_transitive_closure_constraints): Merge the two
constraints.
Index: gcc/tree-ssa-structalias.c
===================================================================
*** gcc/tree-ssa-structalias.c (revision 205803)
--- gcc/tree-ssa-structalias.c (working copy)
*************** set_union_with_increment (bitmap to, bi
*** 962,971 ****
if (bitmap_bit_p (from, anything_id))
return bitmap_set_bit (to, anything_id);
- /* For zero offset simply union the solution into the destination. */
- if (inc == 0)
- return bitmap_ior_into (to, from);
-
/* If the offset is unknown we have to expand the solution to
all subfields. */
if (inc == UNKNOWN_OFFSET)
--- 962,967 ----
*************** do_complex_constraint (constraint_graph_
*** 1788,1801 ****
else
{
bitmap tmp;
- bitmap solution;
bool flag = false;
! gcc_checking_assert (c->rhs.type == SCALAR && c->lhs.type == SCALAR);
! solution = get_varinfo (c->rhs.var)->solution;
tmp = get_varinfo (c->lhs.var)->solution;
! flag = set_union_with_increment (tmp, solution, c->rhs.offset);
if (flag)
bitmap_set_bit (changed, c->lhs.var);
--- 1784,1796 ----
else
{
bitmap tmp;
bool flag = false;
! gcc_checking_assert (c->rhs.type == SCALAR && c->lhs.type == SCALAR
! && c->rhs.offset != 0 && c->lhs.offset == 0);
tmp = get_varinfo (c->lhs.var)->solution;
! flag = set_union_with_increment (tmp, delta, c->rhs.offset);
if (flag)
bitmap_set_bit (changed, c->lhs.var);
*************** make_transitive_closure_constraints (var
*** 3712,3726 ****
lhs.offset = 0;
rhs.type = DEREF;
rhs.var = vi->id;
- rhs.offset = 0;
- process_constraint (new_constraint (lhs, rhs));
-
- /* VAR = VAR + UNKNOWN; */
- lhs.type = SCALAR;
- lhs.var = vi->id;
- lhs.offset = 0;
- rhs.type = SCALAR;
- rhs.var = vi->id;
rhs.offset = UNKNOWN_OFFSET;
process_constraint (new_constraint (lhs, rhs));
}
--- 3707,3712 ----