-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replacing copyins and copyouts with data-movement instructions
o Moved BlockId stuff to a new file to avoid module recursion o Defined stack areas for parameter-passing locations and spill slots o Part way through replacing copy in and copy out nodes - added movement instructions for stack pointer - added movement instructions for call and return parameters (but not with the proper calling conventions) o Inserting spills and reloads for proc points is now procpoint-aware (it was relying on the presence of a CopyIn node as a proxy for procpoint knowledge) o Changed ZipDataflow to expect AGraphs (instead of being polymorphic in the type of graph)
- Loading branch information
dias@eecs.harvard.edu
committed
May 29, 2008
1 parent
724a9e8
commit 0d80489
Showing
41 changed files
with
302 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
module BlockId | ||
( BlockId(..), mkBlockId -- ToDo: BlockId should be abstract, but it isn't yet | ||
, BlockEnv, emptyBlockEnv, lookupBlockEnv, extendBlockEnv, mkBlockEnv | ||
, BlockSet, emptyBlockSet, elemBlockSet, extendBlockSet, sizeBlockSet, mkBlockSet | ||
) where | ||
|
||
import Outputable | ||
import UniqFM | ||
import Unique | ||
import UniqSet | ||
|
||
---------------------------------------------------------------- | ||
--- Block Ids, their environments, and their sets | ||
|
||
{- Note [Unique BlockId] | ||
~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Although a 'BlockId' is a local label, for reasons of implementation, | ||
'BlockId's must be unique within an entire compilation unit. The reason | ||
is that each local label is mapped to an assembly-language label, and in | ||
most assembly languages allow, a label is visible throughout the enitre | ||
compilation unit in which it appears. | ||
-} | ||
|
||
newtype BlockId = BlockId Unique | ||
deriving (Eq,Ord) | ||
|
||
instance Uniquable BlockId where | ||
getUnique (BlockId u) = u | ||
|
||
mkBlockId :: Unique -> BlockId | ||
mkBlockId uniq = BlockId uniq | ||
|
||
instance Show BlockId where | ||
show (BlockId u) = show u | ||
|
||
instance Outputable BlockId where | ||
ppr = ppr . getUnique | ||
|
||
|
||
type BlockEnv a = UniqFM {- BlockId -} a | ||
emptyBlockEnv :: BlockEnv a | ||
emptyBlockEnv = emptyUFM | ||
mkBlockEnv :: [(BlockId,a)] -> BlockEnv a | ||
mkBlockEnv = listToUFM | ||
lookupBlockEnv :: BlockEnv a -> BlockId -> Maybe a | ||
lookupBlockEnv = lookupUFM | ||
extendBlockEnv :: BlockEnv a -> BlockId -> a -> BlockEnv a | ||
extendBlockEnv = addToUFM | ||
|
||
type BlockSet = UniqSet BlockId | ||
emptyBlockSet :: BlockSet | ||
emptyBlockSet = emptyUniqSet | ||
elemBlockSet :: BlockId -> BlockSet -> Bool | ||
elemBlockSet = elementOfUniqSet | ||
extendBlockSet :: BlockSet -> BlockId -> BlockSet | ||
extendBlockSet = addOneToUniqSet | ||
mkBlockSet :: [BlockId] -> BlockSet | ||
mkBlockSet = mkUniqSet | ||
sizeBlockSet :: BlockSet -> Int | ||
sizeBlockSet = sizeUniqSet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ module CmmCPS ( | |
|
||
#include "HsVersions.h" | ||
|
||
import BlockId | ||
import Cmm | ||
import CmmLint | ||
import PprCmm | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ module CmmLint ( | |
cmmLint, cmmLintTop | ||
) where | ||
|
||
import BlockId | ||
import Cmm | ||
import CLabel | ||
import MachOp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ module CmmLive ( | |
|
||
#include "HsVersions.h" | ||
|
||
import BlockId | ||
import Cmm | ||
import Dataflow | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.