)
where
-
------
import UniqSet
import Unique
-- Some basic register classes.
-- These aren't nessesarally in 1-to-1 correspondance with the allocatable
-- RegClasses in MachRegs.hs
---
data RegClass
-- general purpose regs
= ClassG32 -- 32 bit GPRs
-- | so we can put regs in UniqSets
instance Uniquable Reg where
getUnique (Reg c i)
- = mkUnique 'R'
+ = mkRegSingleUnique
$ fromEnum c * 1000 + i
getUnique (RegSub s (Reg c i))
- = mkUnique 'S'
+ = mkRegSubUnique
$ fromEnum s * 10000 + fromEnum c * 1000 + i
getUnique (RegSub _ (RegSub _ _))
-- This should be hand coded/cached for each particular architecture,
-- because the compute time is very long..
-
worst
:: (RegClass -> UniqSet Reg)
-> (Reg -> UniqSet Reg)
-- | For a node N of classN and neighbors of classesC
-- (bound classN classesC) is the maximum number of potential
-- colors for N that can be lost by coloring its neighbors.
---
-
bound
:: (RegClass -> UniqSet Reg)
-> (Reg -> UniqSet Reg)
--
-- A version of this should be constructed for each particular architecture,
-- possibly including uses of bound, so that alised registers don't get counted
--- twice, as per the paper.
---
+-- twice, as per the paper.
squeese
:: (RegClass -> UniqSet Reg)
-> (Reg -> UniqSet Reg)