[PATCH] Improve write-only heuristics for SFT generation
Richard Guenther
rguenther@suse.de
Thu Mar 2 10:09:00 GMT 2006
This patch improves the heuristics for not generating SFTs for structures
that are written to only. Originally these heuristics had been introduced
to fix a gfortran compile performance regression. While retaining this
fix, the following patch improves the heuristic, so that for C++ with
inlining (like tramp3d), where uses of the original variables are scarce
and accesses are through chains of tmp = &foo; *tmp = ... temporaries.
The simple solution is to treat tmp = &foo; as a use of foo that makes
it (possibly) read/write. I verified that this re-gains runtime
performance for tramp3d due to SFTing of iterators with arrays and that
the compile-times for Polyhedron are unchanged.
Bootstrapped and regtested on x86_64-unknown-linux-gnu.
Ok for mainline?
Thanks,
Richard.
2006-03-02 Richard Guenther <rguenther@suse.de>
* tree-ssa-alias.c (find_used_portions): Consider taking
the address as making the variable not write-only.
Index: tree-ssa-alias.c
===================================================================
*** tree-ssa-alias.c (revision 111631)
--- tree-ssa-alias.c (working copy)
*************** find_used_portions (tree *tp, int *walk_
*** 3071,3076 ****
--- 3071,3078 ----
up->minused = 0;
up->maxused = TREE_INT_CST_LOW (DECL_SIZE (var));
up->implicit_uses = true;
+ if (!lhs_p)
+ up->write_only = false;
up_insert (uid, up);
*walk_subtrees = 0;
More information about the Gcc-patches
mailing list