summaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPC.h
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-04-08 16:24:03 +0000
committerHal Finkel <hfinkel@anl.gov>2013-04-08 16:24:03 +0000
commit5ee67e8e76dfcaffa5e776ef3d5eeb80807a627b (patch)
tree5320cc3ba452b158e02aa6cd235be0fc66bcda8b /lib/Target/PowerPC/PPC.h
parentd6b89ef0fa17cf77677358a797934fa061564f5b (diff)
downloadllvm-5ee67e8e76dfcaffa5e776ef3d5eeb80807a627b.tar.gz
llvm-5ee67e8e76dfcaffa5e776ef3d5eeb80807a627b.tar.bz2
llvm-5ee67e8e76dfcaffa5e776ef3d5eeb80807a627b.tar.xz
Generate PPC early conditional returns
PowerPC has a conditional branch to the link register (return) instruction: BCLR. This should be used any time when we'd otherwise have a conditional branch to a return. This adds a small pass, PPCEarlyReturn, which runs just prior to the branch selection pass (and, importantly, after block placement) to generate these conditional returns when possible. It will also eliminate unconditional branches to returns (these happen rarely; most of the time these have already been tail duplicated by the time PPCEarlyReturn is invoked). This is a nice optimization for small functions that do not maintain a stack frame. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179026 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPC.h')
-rw-r--r--lib/Target/PowerPC/PPC.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/PowerPC/PPC.h b/lib/Target/PowerPC/PPC.h
index 446b6854fb..b4be51a8ca 100644
--- a/lib/Target/PowerPC/PPC.h
+++ b/lib/Target/PowerPC/PPC.h
@@ -31,6 +31,7 @@ namespace llvm {
class MCInst;
FunctionPass *createPPCCTRLoops();
+ FunctionPass *createPPCEarlyReturnPass();
FunctionPass *createPPCBranchSelectionPass();
FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
FunctionPass *createPPCJITCodeEmitterPass(PPCTargetMachine &TM,
@@ -40,7 +41,7 @@ namespace llvm {
/// \brief Creates an PPC-specific Target Transformation Info pass.
ImmutablePass *createPPCTargetTransformInfoPass(const PPCTargetMachine *TM);
-
+
namespace PPCII {
/// Target Operand Flag enum.