aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Transforms/Utils/Local.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-10 22:26:15 +0000
committerChris Lattner <sabre@nondot.org>2009-11-10 22:26:15 +0000
commit40d8c28b27377199b7465ba2c5a2c59c6fd12fa9 (patch)
tree236e0fd587325e3ea4c3eedf68afa6e8e1470dd9 /include/llvm/Transforms/Utils/Local.h
parent5b37fbac1aece6bb970656a4f847a6af71dfff23 (diff)
downloadexternal_llvm-40d8c28b27377199b7465ba2c5a2c59c6fd12fa9.zip
external_llvm-40d8c28b27377199b7465ba2c5a2c59c6fd12fa9.tar.gz
external_llvm-40d8c28b27377199b7465ba2c5a2c59c6fd12fa9.tar.bz2
move some generally useful functions out of jump threading
into libanalysis and transformutils. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86735 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms/Utils/Local.h')
-rw-r--r--include/llvm/Transforms/Utils/Local.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h
index 24be83c..292af1d 100644
--- a/include/llvm/Transforms/Utils/Local.h
+++ b/include/llvm/Transforms/Utils/Local.h
@@ -78,6 +78,21 @@ void RecursivelyDeleteDeadPHINode(PHINode *PN);
// Control Flow Graph Restructuring.
//
+/// RemovePredecessorAndSimplify - Like BasicBlock::removePredecessor, this
+/// method is called when we're about to delete Pred as a predecessor of BB. If
+/// BB contains any PHI nodes, this drops the entries in the PHI nodes for Pred.
+///
+/// Unlike the removePredecessor method, this attempts to simplify uses of PHI
+/// nodes that collapse into identity values. For example, if we have:
+/// x = phi(1, 0, 0, 0)
+/// y = and x, z
+///
+/// .. and delete the predecessor corresponding to the '1', this will attempt to
+/// recursively fold the 'and' to 0.
+void RemovePredecessorAndSimplify(BasicBlock *BB, BasicBlock *Pred,
+ TargetData *TD = 0);
+
+
/// MergeBasicBlockIntoOnlyPred - BB is a block with one predecessor and its
/// predecessor is known to have one successor (BB!). Eliminate the edge
/// between them, moving the instructions in the predecessor into BB. This