summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-21 01:28:02 +0000
committerChris Lattner <sabre@nondot.org>2008-04-21 01:28:02 +0000
commit54b9c3ba2a5b0aa8fda817bcc72c370040cfb3f8 (patch)
tree9c74968eb34fbbee3f53742bb676e32e2c2cffdd /include
parent1b58678d541b424da32195470664e373706e7898 (diff)
downloadllvm-54b9c3ba2a5b0aa8fda817bcc72c370040cfb3f8.tar.gz
llvm-54b9c3ba2a5b0aa8fda817bcc72c370040cfb3f8.tar.bz2
llvm-54b9c3ba2a5b0aa8fda817bcc72c370040cfb3f8.tar.xz
Move SplitBlockPredecessors out of loopsimplify into BasicBlockUtils.h
as a global helper function. At the same type, switch it from taking a vector of predecessors to an arbitrary sequential input. This allows us to switch LoopSimplify to use a SmallVector for various temporary vectors that it passed into SplitBlockPredecessors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Transforms/Utils/BasicBlockUtils.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h
index 4230cb1dd1..a44095f27d 100644
--- a/include/llvm/Transforms/Utils/BasicBlockUtils.h
+++ b/include/llvm/Transforms/Utils/BasicBlockUtils.h
@@ -120,6 +120,19 @@ BasicBlock *SplitEdge(BasicBlock *From, BasicBlock *To, Pass *P);
/// the loop info is updated.
///
BasicBlock *SplitBlock(BasicBlock *Old, Instruction *SplitPt, Pass *P);
+
+/// SplitBlockPredecessors - This method transforms BB by introducing a new
+/// basic block into the function, and moving some of the predecessors of BB to
+/// be predecessors of the new block. The new predecessors are indicated by the
+/// Preds array, which has NumPreds elements in it. The new block is given a
+/// suffix of 'Suffix'. This function returns the new block.
+///
+/// This currently updates the LLVM IR, AliasAnalysis, DominatorTree and
+/// DominanceFrontier, but no other analyses.
+BasicBlock *SplitBlockPredecessors(BasicBlock *BB, BasicBlock *const *Preds,
+ unsigned NumPreds, const char *Suffix,
+ Pass *P = 0);
+
} // End llvm namespace
#endif