summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
diff options
context:
space:
mode:
authorLei Huang <lei@ca.ibm.com>2017-08-23 19:25:04 +0000
committerLei Huang <lei@ca.ibm.com>2017-08-23 19:25:04 +0000
commit0cb591fc4c5a5c8cf561e8f2b01e88941936578e (patch)
treee543037f2852ed9954fa7bdcbaac0791b895495d /llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
parent7dbd1fd73b3a356ce75b4b9a9da7dc83dd760744 (diff)
downloadbcm5719-llvm-0cb591fc4c5a5c8cf561e8f2b01e88941936578e.tar.gz
bcm5719-llvm-0cb591fc4c5a5c8cf561e8f2b01e88941936578e.zip
Update branch coalescing to be a PowerPC specific pass
Implementing this pass as a PowerPC specific pass. Branch coalescing utilizes the analyzeBranch method which currently does not include any implicit operands. This is not an issue on PPC but must be handled on other targets. Differential Revision : https: // reviews.llvm.org/D32776 llvm-svn: 311588
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCTargetMachine.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
index bc5d32b37fd..18426bdb6bf 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
@@ -40,6 +40,10 @@
using namespace llvm;
+
+static cl::opt<bool>
+ DisableBranchCoalescing("disable-ppc-branch-coalesce", cl::Hidden,
+ cl::desc("disable coalescing of duplicate branches for PPC"));
static cl::
opt<bool> DisableCTRLoops("disable-ppc-ctrloops", cl::Hidden,
cl::desc("Disable CTR loops for PPC"));
@@ -378,6 +382,10 @@ bool PPCPassConfig::addInstSelector() {
}
void PPCPassConfig::addMachineSSAOptimization() {
+ // PPCBranchCoalescingPass need to be done before machine sinking
+ // since it merges empty blocks.
+ if (!DisableBranchCoalescing && getOptLevel() != CodeGenOpt::None)
+ addPass(createPPCBranchCoalescingPass());
TargetPassConfig::addMachineSSAOptimization();
// For little endian, remove where possible the vector swap instructions
// introduced at code generation to normalize vector element order.
OpenPOWER on IntegriCloud