Substantial rewrite of code that computes register map of a basic
authorChris Hanson <org/chris-hanson/cph>
Mon, 7 Nov 1988 14:08:14 +0000 (14:08 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 7 Nov 1988 14:08:14 +0000 (14:08 +0000)
commit890a9fbf56cb7716026cf8c2447a71c581d1cf68
treee763f5a9f5e94c658e51b3be8b3ad80c163b49c0
parent9e2dfa82a458475762e2dae63348aa7de64a1e37
Substantial rewrite of code that computes register map of a basic
block with multiple "previous" edges.  The algorithm is roughly as
follows:

* Wait until all of the "previous" nodes have been generated.  This
depends on the absence of explicit loops in the graph, and will
require some rethinking when we introduce these loops.

* Compute a "weighted average" register map (the target map) from the
maps of the "previous" nodes.  This is a heuristic computation, but it
seems to have about the right effect for simple cases.

* Separate the "previous" maps into equivalence classes, where all the
maps in an equivalence class can be converted to the target map with
an identical sequence of instructions.  This could be made
substantially more sophisticated, but for now it will do.

* For each edge, insert code to coerce the "previous" map into the
target map.  Heed the equivalence classes that were just computed, and
causes all maps in a given equivalence class to share a single code
sequence.
v7/src/compiler/back/lapgn1.scm