diff options
author | Dan Gohman <gohman@apple.com> | 2009-10-31 16:08:00 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-10-31 16:08:00 +0000 |
commit | f230d8ad15f7ad5cdc5f3950b9d4f0c773d0bac0 (patch) | |
tree | 5152d19973d0bd6384e3736e5a41562925ef237b /include | |
parent | 4c7279ac726e338400626fca5a09b5533426eb6a (diff) | |
download | external_llvm-f230d8ad15f7ad5cdc5f3950b9d4f0c773d0bac0.zip external_llvm-f230d8ad15f7ad5cdc5f3950b9d4f0c773d0bac0.tar.gz external_llvm-f230d8ad15f7ad5cdc5f3950b9d4f0c773d0bac0.tar.bz2 |
Merge the enhancements from LoopUnroll's FoldBlockIntoPredecessor into
MergeBlockIntoPredecessor. This makes SimplifyCFG slightly more aggressive,
and makes it unnecessary for LoopUnroll to have its own copy of this code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85667 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Transforms/Utils/BasicBlockUtils.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h index e766d72..47d6895 100644 --- a/include/llvm/Transforms/Utils/BasicBlockUtils.h +++ b/include/llvm/Transforms/Utils/BasicBlockUtils.h @@ -43,9 +43,11 @@ void FoldSingleEntryPHINodes(BasicBlock *BB); /// it is ultimately unused or if it reaches an unused cycle. void DeleteDeadPHIs(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); +/// MergeBlockIntoPredecessor - Folds a basic block into its predecessor if it +/// only has one predecessor, and that predecessor only has one successor. +/// If a Pass is given, the LoopInfo and DominatorTree analyses will be kept +/// current. Returns the combined block, or null if no merging was performed. +BasicBlock *MergeBlockIntoPredecessor(BasicBlock* BB, Pass* P = 0); // ReplaceInstWithValue - Replace all uses of an instruction (specified by BI) // with a value, then remove and delete the original instruction. |