diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-21 01:28:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-21 01:28:02 +0000 |
commit | 6b8d3dbd84bf3e72f2b691cf6c6c50a305a84f8c (patch) | |
tree | 9c74968eb34fbbee3f53742bb676e32e2c2cffdd /include/llvm/Transforms | |
parent | 24afaaddb405168d54495bdcf90210bde5f6545f (diff) | |
download | external_llvm-6b8d3dbd84bf3e72f2b691cf6c6c50a305a84f8c.zip external_llvm-6b8d3dbd84bf3e72f2b691cf6c6c50a305a84f8c.tar.gz external_llvm-6b8d3dbd84bf3e72f2b691cf6c6c50a305a84f8c.tar.bz2 |
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/llvm/Transforms')
-rw-r--r-- | include/llvm/Transforms/Utils/BasicBlockUtils.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h index 4230cb1..a44095f 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 |