diff options
author | Hal Finkel <hfinkel@anl.gov> | 2013-04-09 22:58:37 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2013-04-09 22:58:37 +0000 |
commit | 5711eca19cfa8375e41189119fe770b326f9e721 (patch) | |
tree | 028322742f521cf7cab07ac3ca84aaa685bb848b /llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | |
parent | aa577f464ddfc333b3f382cd98cfa4d8cc699fae (diff) | |
download | llvm-5711eca19cfa8375e41189119fe770b326f9e721.zip llvm-5711eca19cfa8375e41189119fe770b326f9e721.tar.gz llvm-5711eca19cfa8375e41189119fe770b326f9e721.tar.bz2 |
Allow PPC B and BLR to be if-converted into some predicated forms
This enables us to form predicated branches (which are the same conditional
branches we had before) and also a larger set of predicated returns (including
instructions like bdnzlr which is a conditional return and loop-counter
decrement all in one).
At the moment, if conversion does not capture all possible opportunities. A
simple example is provided in early-ret2.ll, where if conversion forms one
predicated return, and then the PPCEarlyReturn pass picks up the other one. So,
at least for now, we'll keep both mechanisms.
llvm-svn: 179134
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp index caf5c98..14dc794 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -93,6 +93,7 @@ public: virtual bool addPreRegAlloc(); virtual bool addILPOpts(); virtual bool addInstSelector(); + virtual bool addPreSched2(); virtual bool addPreEmitPass(); }; } // namespace @@ -123,6 +124,13 @@ bool PPCPassConfig::addInstSelector() { return false; } +bool PPCPassConfig::addPreSched2() { + if (getOptLevel() != CodeGenOpt::None) + addPass(&IfConverterID); + + return true; +} + bool PPCPassConfig::addPreEmitPass() { if (getOptLevel() != CodeGenOpt::None) addPass(createPPCEarlyReturnPass()); |