This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Improve write-only heuristics for SFT generation
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Daniel Berlin <dberlin at dberlin dot org>
- Date: Thu, 2 Mar 2006 11:09:10 +0100 (CET)
- Subject: [PATCH] Improve write-only heuristics for SFT generation
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;