diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-08-20 11:17:05 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-08-20 11:17:05 +0200 |
commit | 965f8bf85d7850be074bad735d815b15a85a3de0 (patch) | |
tree | 915cb183c943c503c4b4a561679b7edc2e4a2938 /RegAlloc.hs | |
parent | 694ec05bcad01fd27606aace73b49cdade16945e (diff) |
Second
Diffstat (limited to 'RegAlloc.hs')
-rw-r--r-- | RegAlloc.hs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/RegAlloc.hs b/RegAlloc.hs index d2b1717..3a41aac 100644 --- a/RegAlloc.hs +++ b/RegAlloc.hs @@ -42,8 +42,7 @@ regalloc vars' regs aliaspairs = AllocReg r -> Just r in if length (stActive st) == length regs then spillAtInterval st index - else let -- ([regchoice], fr) = splitAt 1 (stFreeRegs st) - (regchoice, fr) = case find (`elem` wantedregs) (stFreeRegs st) of + else let (regchoice, fr) = case find (`elem` wantedregs) (stFreeRegs st) of Nothing -> (head (stFreeRegs st), tail (stFreeRegs st)) Just wr -> trace ("Pair-allocated " ++ show name ++ " in " ++ show wr) $ (wr, stFreeRegs st \\ [wr]) |