summaryrefslogtreecommitdiff
path: root/include/llvm/Transforms
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-01-29 01:29:26 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-01-29 01:29:26 +0000
commit5e6940788fb2f8cf3ce4219d3ac0f78317f54696 (patch)
tree1bd84907741911ab97ccfede07b0fe05dcca2981 /include/llvm/Transforms
parent04317cc618aeae28910916469e074d8ce0fcaa03 (diff)
downloadllvm-5e6940788fb2f8cf3ce4219d3ac0f78317f54696.tar.gz
llvm-5e6940788fb2f8cf3ce4219d3ac0f78317f54696.tar.bz2
llvm-5e6940788fb2f8cf3ce4219d3ac0f78317f54696.tar.xz
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')
-rw-r--r--include/llvm/Transforms/Utils/BasicBlockUtils.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h
index 6de8b85070..5335860287 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