From 21683f6922202e4588e6c84bc281d6b9690cba77 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sat, 30 Nov 2019 10:14:45 +0100 Subject: Fix propagation bug in liveness analysis --- Liveness.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Liveness.hs') 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 -- cgit v1.2.3-54-g00ecf