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]
Other format: [Raw text]

[PATCH] cselib.c memory invalidation shortcut


Hi,

In alias.c, we have this comment:

 /* (mem:BLK (scratch)) is a special mechanism to conflict with everything.
    This is used in epilogue deallocation functions, and in cselib.  */

With this patch, we use this in cselib too.

Bootstrapped and tested long ago on x86_64-linux.  I'll commit this to
the trunk unless someone objects.

Gr.
Steven

* cselib.c (cselib_init): Use special MEM rtx form for callmem.
* alias.c (canon_true_dependence): Update comment.
Index: alias.c
===================================================================
--- alias.c	(revision 119295)
+++ alias.c	(working copy)
@@ -2227,7 +2227,7 @@
     return 1;
 
   /* (mem:BLK (scratch)) is a special mechanism to conflict with everything.
-     This is used in epilogue deallocation functions.  */
+     This is used in epilogue deallocation functions, and in cselib.  */
   if (GET_MODE (x) == BLKmode && GET_CODE (XEXP (x, 0)) == SCRATCH)
     return 1;
   if (GET_MODE (mem) == BLKmode && GET_CODE (XEXP (mem, 0)) == SCRATCH)
Index: cselib.c
===================================================================
--- cselib.c	(revision 119295)
+++ cselib.c	(working copy)
@@ -1473,9 +1473,11 @@
 				       sizeof (cselib_val), 10);
   value_pool = create_alloc_pool ("value", RTX_CODE_SIZE (VALUE), 100);
   cselib_record_memory = record_memory;
-  /* This is only created once.  */
+
+  /* (mem:BLK (scratch)) is a special mechanism to conflict with everything,
+      see canon_true_dependence.  This is only created once.  */
   if (! callmem)
-    callmem = gen_rtx_MEM (BLKmode, const0_rtx);
+    callmem = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (VOIDmode));
 
   cselib_nregs = max_reg_num ();
 

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