This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix ia64 performance regression for 147.vortex in SPEC95
- To: <gcc-patches at gcc dot gnu dot org>
- Subject: Fix ia64 performance regression for 147.vortex in SPEC95
- From: Bernd Schmidt <bernds at redhat dot com>
- Date: Sun, 5 Aug 2001 18:01:57 +0100 (BST)
Earlier this year, a perfectly reasonable patch by Richard Kenner caused
a 20% performance drop in one of the SPEC95 benchmarks on ia64. This is
the patch I came up with a few months ago, and since I can't figure out
a better way to fix it, I'm installing it. By now I've convinced myself
that this is the correct approach.
Basically, what it does is to use a temporary register instead of directly
using a memory address that will eventually be the target. This way, we
end up with slightly higher register pressure, but less memory traffic,
which is apparently what is causing the slowdown.
Tested like the previous patches.
Bernd
* expr.c (expand_expr, case COND_EXPR): Prefer working with a
temporary register than directly using a MEM.
Index: expr.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/expr.c,v
retrieving revision 1.444.12.1
diff -u -p -r1.444.12.1 expr.c
--- expr.c 2001/06/19 04:43:03 1.444.12.1
+++ expr.c 2001/08/05 09:46:16
@@ -8224,8 +8224,8 @@ expand_expr (exp, target, tmode, modifie
|| GET_CODE (original_target) == REG
|| TREE_ADDRESSABLE (type))
#endif
- && ! (GET_CODE (original_target) == MEM
- && MEM_VOLATILE_P (original_target)))
+ && (GET_CODE (original_target) != MEM
+ || TREE_ADDRESSABLE (type)))
temp = original_target;
else if (TREE_ADDRESSABLE (type))
abort ();