From 014549aea8d61c36dbb498666779e600a6406d20 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Thu, 12 Nov 2009 15:33:32 +0000 Subject: [PATCH] Comments only --- compiler/cmm/CmmSpillReload.hs | 31 +++++++++++++++++-------------- compiler/cmm/cmm-notes | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/compiler/cmm/CmmSpillReload.hs b/compiler/cmm/CmmSpillReload.hs index 1cdafa9..df05a65 100644 --- a/compiler/cmm/CmmSpillReload.hs +++ b/compiler/cmm/CmmSpillReload.hs @@ -31,20 +31,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 } diff --git a/compiler/cmm/cmm-notes b/compiler/cmm/cmm-notes index 2fab86f..823fd0a 100644 --- a/compiler/cmm/cmm-notes +++ b/compiler/cmm/cmm-notes @@ -2,6 +2,24 @@ Notes on new codegen (Sept 09) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Things to do: + + - CmmContFlowOpt.runCmmContFlowOptZs is not called! + - Why is runCmmOpts called from HscMain? Seems too "high up". + In fact HscMain calls (runCmmOpts cmmCfgOptsZ) which is what + runCmmContFlowOptZs does. Tidy up! + + + - AsmCodeGen has a generic Cmm optimiser; move this into new pipeline + + - AsmCodeGen has post-native-cg branch elimiator (shortCutBranches); + we ultimately want to share this with the Cmm branch eliminator. + + - At the moment, references to global registers like Hp are "lowered" + late (in AsmCodeGen.fixAssignTop and cmmToCmm). We should do this + early, in the new native codegen, much in the way that we lower + calling conventions. Might need to be a bit sophisticated about + aliasing. + - Refactor Cmm so that it contains only shared stuff Add a module MoribundCmm which contains stuff from Cmm for old code gen path -- 1.7.10.4