aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Transforms/Utils/BasicBlockUtils.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-12-03 19:44:02 +0000
committerChris Lattner <sabre@nondot.org>2008-12-03 19:44:02 +0000
commit29874e0dc6c4e55bc384611273343bb358982cc3 (patch)
treeff01073ac8df137035c562888c7cd0f61b60d29f /include/llvm/Transforms/Utils/BasicBlockUtils.h
parente96cc775e496260b7a42dbd6148dffb0575d1304 (diff)
downloadexternal_llvm-29874e0dc6c4e55bc384611273343bb358982cc3.tar.gz
external_llvm-29874e0dc6c4e55bc384611273343bb358982cc3.tar.bz2
external_llvm-29874e0dc6c4e55bc384611273343bb358982cc3.zip
Factor some code into a new FoldSingleEntryPHINodes method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60501 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms/Utils/BasicBlockUtils.h')
-rw-r--r--include/llvm/Transforms/Utils/BasicBlockUtils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h
index 6dd92dd71f..429d3b6edc 100644
--- a/include/llvm/Transforms/Utils/BasicBlockUtils.h
+++ b/include/llvm/Transforms/Utils/BasicBlockUtils.h
@@ -30,6 +30,14 @@ class AliasAnalysis;
/// predecessors.
void DeleteDeadBlock(BasicBlock *BB);
+
+/// FoldSingleEntryPHINodes - We know that BB has one predecessor. If there are
+/// any single-entry PHI nodes in it, fold them away. This handles the case
+/// when all entries to the PHI nodes in a block are guaranteed equal, such as
+/// when the block has exactly one predecessor.
+void FoldSingleEntryPHINodes(BasicBlock *BB);
+
+
/// MergeBlockIntoPredecessor - Attempts to merge a block into its predecessor,
/// if possible. The return value indicates success or failure.
bool MergeBlockIntoPredecessor(BasicBlock* BB, Pass* P = 0);