summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-07-18 13:33:45 +0100
committerSimon Marlow <marlowsd@gmail.com>2012-07-30 11:42:14 +0100
commit6c2c07c5c98adac365cc3da912ceb209bee41a61 (patch)
tree6045e1123894132d2b1029b3cbe70aa6e12a0d63 /compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs
parent93c03f84c4bfebea5faeb60d75d708a578413e4a (diff)
downloadhaskell-6c2c07c5c98adac365cc3da912ceb209bee41a61.tar.gz
bugfix: cope when a source reg is dead at a join point
We didn't trip over this one until I started generating code without proc-point splitting, which has more join points and loops.
Diffstat (limited to 'compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs')
-rw-r--r--compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs14
1 files changed, 4 insertions, 10 deletions
diff --git a/compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs b/compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs
index 3bf49a31f2..c17b65d6e2 100644
--- a/compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs
+++ b/compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs
@@ -235,16 +235,10 @@ joinToTargets_again
--
makeRegMovementGraph :: RegMap Loc -> RegMap Loc -> [(Unique, Loc, [Loc])]
makeRegMovementGraph adjusted_assig dest_assig
- = let
- mkNodes src vreg
- = expandNode vreg src
- $ lookupWithDefaultUFM_Directly
- dest_assig
- (panic "RegAllocLinear.makeRegMovementGraph")
- vreg
-
- in [ node | (vreg, src) <- ufmToList adjusted_assig
- , node <- mkNodes src vreg ]
+ = [ node | (vreg, src) <- ufmToList adjusted_assig
+ -- source reg might not be needed at the dest:
+ , Just loc <- [lookupUFM_Directly dest_assig vreg]
+ , node <- expandNode vreg src loc ]
-- | Expand out the destination, so InBoth destinations turn into