X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fcmm%2FCmmSpillReload.hs;h=c457383e6b6448eb32a520b0bdde8bfffa6399c5;hp=1cdafa9baa335446cb5ce693f0d51980859db6e8;hb=edc0bafd3fcd01b85a2e8894e5dfe149eb0e0857;hpb=ced4c754ae05fcd3fb7afb0ca3218517011f231c diff --git a/compiler/cmm/CmmSpillReload.hs b/compiler/cmm/CmmSpillReload.hs index 1cdafa9..c457383 100644 --- a/compiler/cmm/CmmSpillReload.hs +++ b/compiler/cmm/CmmSpillReload.hs @@ -1,3 +1,6 @@ +{-# OPTIONS_GHC -XNoMonoLocalBinds #-} +-- Norman likes local bindings +-- If this module lives on I'd like to get rid of this flag in due course module CmmSpillReload ( DualLive(..) @@ -31,20 +34,23 @@ import UniqSet import Data.Maybe import Prelude hiding (zip) --- The point of this module is to insert spills and reloads to --- establish the invariant that at a call (or at any proc point with --- an established protocol) all live variables not expected in --- registers are sitting on the stack. We use a backward analysis to --- insert spills and reloads. It should be followed by a --- forward transformation to sink reloads as deeply as possible, so as --- to reduce register pressure. - --- A variable can be expected to be live in a register, live on the --- stack, or both. This analysis ensures that spills and reloads are --- inserted as needed to make sure that every live variable needed --- after a call is available on the stack. Spills are pushed back to --- their reaching definitions, but reloads are dropped wherever needed --- and will have to be sunk by a later forward transformation. +{- Note [Overview of spill/reload] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The point of this module is to insert spills and reloads to +establish the invariant that at a call (or at any proc point with +an established protocol) all live variables not expected in +registers are sitting on the stack. We use a backward analysis to +insert spills and reloads. It should be followed by a +forward transformation to sink reloads as deeply as possible, so as +to reduce register pressure. + +A variable can be expected to be live in a register, live on the +stack, or both. This analysis ensures that spills and reloads are +inserted as needed to make sure that every live variable needed +after a call is available on the stack. Spills are pushed back to +their reaching definitions, but reloads are dropped wherever needed +and will have to be sunk by a later forward transformation. +-} data DualLive = DualLive { on_stack :: RegSet, in_regs :: RegSet }