diff options
Diffstat (limited to 'compiler/nativeGen/RegAlloc/Graph/Spill.hs')
-rw-r--r-- | compiler/nativeGen/RegAlloc/Graph/Spill.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/nativeGen/RegAlloc/Graph/Spill.hs b/compiler/nativeGen/RegAlloc/Graph/Spill.hs index 1ec8d1276f..9c3ccae315 100644 --- a/compiler/nativeGen/RegAlloc/Graph/Spill.hs +++ b/compiler/nativeGen/RegAlloc/Graph/Spill.hs @@ -62,9 +62,12 @@ regSpill platform code slotsFree regs | otherwise = do -- Allocate a slot for each of the spilled regs. - let slots = take (sizeUniqSet regs) $ uniqSetToList slotsFree + let slots = take (sizeUniqSet regs) $ nonDetEltsUFM slotsFree let regSlotMap = listToUFM - $ zip (uniqSetToList regs) slots + $ zip (nonDetEltsUFM regs) slots + -- This is non-deterministic but we do not + -- currently support deterministic code-generation. + -- See Note [Unique Determinism and code generation] -- Grab the unique supply from the monad. us <- getUniqueSupplyM @@ -139,7 +142,8 @@ regSpill_top platform regSlotMap cmm moreSlotsLive = Set.fromList $ catMaybes $ map (lookupUFM regSlotMap) - $ uniqSetToList regsLive + $ nonDetEltsUFM regsLive + -- See Note [Unique Determinism and code generation] slotMap' = Map.insert blockId (Set.union curSlotsLive moreSlotsLive) |