diff options
author | tomsmeding <tom.smeding@gmail.com> | 2019-11-30 10:14:45 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2019-11-30 10:20:57 +0100 |
commit | 21683f6922202e4588e6c84bc281d6b9690cba77 (patch) | |
tree | 1f749abba89265afc056b7e319291f5c857193a6 | |
parent | d4a795139f6e642441f0b497663d35f025a9480c (diff) |
Fix propagation bug in liveness analysis
-rw-r--r-- | Liveness.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Liveness.hs b/Liveness.hs index 9df5484..40c555b 100644 --- a/Liveness.hs +++ b/Liveness.hs @@ -36,4 +36,4 @@ livenessAnalysis bblocks bidOf bbInss bbNexts fread fwrite = bbTransFs = Map.map (foldr (.) id) insTransFs computeFlow state = let l = iterate flowStep state in fst . head . dropWhile (uncurry (/=)) $ zip l (tail l) flowStep state = foldl updateFlow state bids - updateFlow state bid = Map.insert bid ((bbTransFs Map.! bid) (Set.unions (map (state Map.!) (bidNexts Map.! bid)))) state + updateFlow state bid = Map.insert bid (Set.unions (map (\n -> (bbTransFs Map.! n) (state Map.! n)) (bidNexts Map.! bid))) state |