summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2009-11-26 00:32:21 +0000
committerBob Wilson <bob.wilson@apple.com>2009-11-26 00:32:21 +0000
commit15acadde5f87703da5f36721a19c09a7e3f97f53 (patch)
tree379bad402a664a687cd94163cc84caa3f2438f41 /include
parent36ccdd49f50535b74ce4d54561e426907629270a (diff)
downloadllvm-15acadde5f87703da5f36721a19c09a7e3f97f53.tar.gz
llvm-15acadde5f87703da5f36721a19c09a7e3f97f53.tar.bz2
llvm-15acadde5f87703da5f36721a19c09a7e3f97f53.tar.xz
Split tail duplication into a separate pass. This is needed to avoid
running tail duplication when doing branch folding for if-conversion, and we also want to be able to run tail duplication earlier to fix some reg alloc problems. Move the CanFallThrough function from BranchFolding to MachineBasicBlock so that it can be shared by TailDuplication. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89904 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/MachineBasicBlock.h6
-rw-r--r--include/llvm/CodeGen/Passes.h4
2 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h
index 78662784eb..6b4c64055b 100644
--- a/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/include/llvm/CodeGen/MachineBasicBlock.h
@@ -271,6 +271,12 @@ public:
/// ends with an unconditional branch to some other block.
bool isLayoutSuccessor(const MachineBasicBlock *MBB) const;
+ /// canFallThrough - Return true if the block can implicitly transfer
+ /// control to the block after it by falling off the end of it. This should
+ /// return false if it can reach the block after it, but it uses an explicit
+ /// branch to do so (e.g., a table jump). True is a conservative answer.
+ bool canFallThrough();
+
/// getFirstTerminator - returns an iterator to the first terminator
/// instruction of this basic block. If a terminator does not exist,
/// it returns end()
diff --git a/include/llvm/CodeGen/Passes.h b/include/llvm/CodeGen/Passes.h
index 99444984b4..26167876ef 100644
--- a/include/llvm/CodeGen/Passes.h
+++ b/include/llvm/CodeGen/Passes.h
@@ -129,6 +129,10 @@ namespace llvm {
/// branches.
FunctionPass *createBranchFoldingPass(bool DefaultEnableTailMerge);
+ /// TailDuplication Pass - Duplicate blocks with unconditional branches
+ /// into tails of their predecessors.
+ FunctionPass *createTailDuplicationPass();
+
/// IfConverter Pass - This pass performs machine code if conversion.
FunctionPass *createIfConverterPass();