This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fix ia64 performance regression for 147.vortex in SPEC95


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 ();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]