X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FDataflow.hs;h=0b84016a0f59e08e350e03a614859c6a66e814ea;hb=8bae799da7444d5debe0ce2e3f3f73692991a59d;hp=7f9d0dc20254711b39fcc0990d2dba59c726046d;hpb=d5e821c43df34fa228727e7f4e9453d0fde39fb6;p=ghc-hetmet.git diff --git a/compiler/cmm/Dataflow.hs b/compiler/cmm/Dataflow.hs index 7f9d0dc..0b84016 100644 --- a/compiler/cmm/Dataflow.hs +++ b/compiler/cmm/Dataflow.hs @@ -5,10 +5,7 @@ module Dataflow ( -------------------------------------------------------------------------------- -- Solve a fixed-point of a dataflow problem. --- O(N+H*E) calls to update where --- N = number of nodes, --- E = number of edges, --- H = maximum height of the lattice for any particular node. +-- -- dependants: map from nodes to those who's value depend on the argument node -- update: -- Given the node which needs to be updated, and @@ -21,6 +18,11 @@ module Dataflow ( -- state: some sort of state (usually a map) -- containing the initial value for each node -- +-- Complexity: O(N+H*E) calls to 'update' where +-- N = number of nodes, +-- E = number of edges, +-- H = maximum height of the lattice for any particular node. +-- -- Sketch for proof of complexity: -- Note that the state is threaded through the entire execution. -- Also note that the height of the latice at any particular node