code: def compute_dominance_frontier(nodes):
      '''
          Naive implementation of Cooper, Harvey, Kennedy algo
          See 'A Simple,Fast Dominance Algorithm'
  
          Compute dominance frontier
      '''
      for node in nodes:
          if len(node.fathers) >= 2:
              for father in node.fathers:
                  runner = father
                  # Corner case: if there is a if without else
                  # we need to add update the conditional node 
                  if runner == node.immediate_dominator and runner.type == NodeType.IF and node.type == NodeType.ENDIF:
                      runner.dominance_frontier = runner.dominance_frontier.union({node})
                  while runner != node.immediate_dominator:
                      runner.dominance_frontier = runner.dominance_frontier.union({node})
                      runner = runner.immediate_dominatof compute_dominance_frontier(nodes):
      '''
          Naive implementation of Cooper, Harvey, Kennedy algo
          See 'A Simple,Fast Dominance Algorithm'
  
          Compute dominance frontier
      '''
      for node in nodes:
          if len(node.fathers) >= 2:
              for father in node.fathers:
                  runner = father
                  # Corner case: if there is a if without else
                  # we need to add update the conditional node 
                  if runner == node.immediate_dominator and runner.type == NodeType.IF and node.type == NodeType.ENDIF:
                      runner.dominance_frontier = runner.dominance_frontier.union({node})
                  while runner != node.immediate_dominator:
                      runner.dominance_frontier = runner.dominance_frontier.union({node})
                      runner = runner.immediate_dominator
docs: Naive implementation of Cooper, Harvey, Kennedy algo
          See 'A Simple,Fast Dominance Algorithm'
  
          Compute dominance frontier