(assignment-memory-insertion) Do not perform CSE on the memory
authorChris Hanson <org/chris-hanson/cph>
Fri, 3 Jun 1988 14:54:29 +0000 (14:54 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 3 Jun 1988 14:54:29 +0000 (14:54 +0000)
address.  Doing that causes problems because the memory address cannot
be distinguished from a reference to that address.  The RTL should be
fixed so that these things are distinguished, and then we can
re-enable memory address CSE.

v7/src/compiler/rtlopt/rcse1.scm

index 2f3da946d1243b3f55826adf853294d5b7bf6073..43d6949f5d18cdf709a03222216afe18402a6bdf 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlopt/rcse1.scm,v 4.7 1988/04/26 18:52:37 markf Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlopt/rcse1.scm,v 4.8 1988/06/03 14:54:29 cph Exp $
 
 Copyright (c) 1987 Massachusetts Institute of Technology
 
@@ -220,13 +220,21 @@ MIT in each case. |#
 
 (define (assignment-memory-insertion address hash insert-source!
                                     memory-invalidate!)
+  #|
+  ;; This does not cause bugs (false hash number passed to
+  ;; insert-memory-destination! fixed one), but does not do anything
+  ;; useful.  The idea of doing optimization on the address of a
+  ;; memory assignment does not work since the RTL does not
+  ;; distinguish addresses from references.  When the RTL is changed,
+  ;; we can do CSE on the memory address.
   (let ((address (find-cheapest-expression address hash false)))
     (let ((element (insert-source!)))
       (memory-invalidate!)
-      (insert-memory-destination!
-       address
-       element
-       (modulo (+ (symbol-hash 'ASSIGN) hash) (hash-table-size))))))
+      (insert-memory-destination! address element false)))
+  |#
+  (insert-source!)
+  (memory-invalidate!)
+  (mention-registers! address))
 \f
 (define (trivial-action volatile? insert-source!)
   (if (not volatile?)