diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-01-29 01:29:26 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-01-29 01:29:26 +0000 |
commit | 5e6940788fb2f8cf3ce4219d3ac0f78317f54696 (patch) | |
tree | 1bd84907741911ab97ccfede07b0fe05dcca2981 /include/llvm/Transforms/Utils/BasicBlockUtils.h | |
parent | 04317cc618aeae28910916469e074d8ce0fcaa03 (diff) | |
download | external_llvm-5e6940788fb2f8cf3ce4219d3ac0f78317f54696.zip external_llvm-5e6940788fb2f8cf3ce4219d3ac0f78317f54696.tar.gz external_llvm-5e6940788fb2f8cf3ce4219d3ac0f78317f54696.tar.bz2 |
Re-commit r124462 with fixes. Tail recursion elim will now dup ret into unconditional predecessor to enable TCE on demand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124518 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms/Utils/BasicBlockUtils.h')
-rw-r--r-- | include/llvm/Transforms/Utils/BasicBlockUtils.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h index 6de8b85..5335860 100644 --- a/include/llvm/Transforms/Utils/BasicBlockUtils.h +++ b/include/llvm/Transforms/Utils/BasicBlockUtils.h @@ -22,9 +22,10 @@ namespace llvm { +class AliasAnalysis; class Instruction; class Pass; -class AliasAnalysis; +class ReturnInst; /// DeleteDeadBlock - Delete the specified block, which must have no /// predecessors. @@ -171,7 +172,15 @@ BasicBlock *SplitBlock(BasicBlock *Old, Instruction *SplitPt, Pass *P); BasicBlock *SplitBlockPredecessors(BasicBlock *BB, BasicBlock *const *Preds, unsigned NumPreds, const char *Suffix, Pass *P = 0); - + +/// FoldReturnIntoUncondBranch - This method duplicates the specified return +/// instruction into a predecessor which ends in an unconditional branch. If +/// the return instruction returns a value defined by a PHI, propagate the +/// right value into the return. It returns the new return instruction in the +/// predecessor. +ReturnInst *FoldReturnIntoUncondBranch(ReturnInst *RI, BasicBlock *BB, + BasicBlock *Pred); + } // End llvm namespace #endif |