[ADCE] Modify data structures to support removing control flow
authorDavid Callahan <dcallahan@fb.com>
Tue, 16 Aug 2016 14:31:51 +0000 (14:31 +0000)
committerDavid Callahan <dcallahan@fb.com>
Tue, 16 Aug 2016 14:31:51 +0000 (14:31 +0000)
commit947be0fa667603c095dea847f7759765cec569c9
tree8419429d8306d6004598dc06de8ab4f1b4cea5c9
parentef5db1a5ff0a75eba6a7fe7764f59519d7fd5788
[ADCE] Modify data structures to support removing control flow

Summary:
This is part of a serious of patches to evolve ADCE.cpp to support
removing of unnecessary control flow.

This patch changes the data structures to hold liveness information to
support the additional information we will eventually need. In
particular we now have a notion of basic blocks being live because
they contain a live operations. This will eventually feed into control
dependence analysis of which branches are live. We cater to getting
from instructions to associated block information and from blocks to
information about their terminators.

This patch also changes the structure of the main loop of the
algorithm so that it alternates propagating liveness between
instructions and usign control dependence information to mark branches
live.

We force all terminators live for now until we add code to handlinge
removing control flow in a later patch.

No changes to effective behavior with this patch

Previous patches:

D23065 [ADCE] Refactor anticipating new functionality (NFC)
D23102 [ADCE] Refactoring for new functionality (NFC)

Reviewers: nadav, majnemer, mehdi_amini

Subscribers: freik, twoh, llvm-commits

Differential Revision: https://reviews.llvm.org/D23225

llvm-svn: 278807
llvm/lib/Transforms/Scalar/ADCE.cpp