[PATCH] D12676: Ensure a complete post-dominance tree is built in the presence of unreachables

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 7 06:47:41 PDT 2015


grosser created this revision.
grosser added reviewers: dberlin, chandlerc, arsenm.
grosser added a subscriber: llvm-commits.

This patch ensures a full post-dominance tree is built for all reachable parts
of a CFG even if some parts of the CFG are unreachable. Before this change,
we treated basic blocks that end in both return statements or unreachable
instructions as roots of the post-dominance tree. As a result, as soon as an
unreachable statement was part of the CFG, parts of the post-dominance relation
in the reachable part of the CFG was lost. With this patch, we now only add
returning basic blocks, but not unreachable basic blocks as root nodes to the
post-dominance tree. This means the unreachable blocks are treated identical to
infinite loops. They do not show up in the post-dominance relation and they do
not affect the post-dominance tree of the reachable part of the CFG.

http://reviews.llvm.org/D12676

Files:
  include/llvm/IR/Dominators.h
  include/llvm/Support/GenericDomTree.h
  test/Analysis/PostDominators/unreachables.ll
  test/Analysis/RegionInfo/condition_complicated_2.ll
  test/Analysis/RegionInfo/unreachable_bb.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12676.34156.patch
Type: text/x-patch
Size: 7023 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150907/f2dbb441/attachment.bin>


More information about the llvm-commits mailing list