diff options
author | Hal Finkel <hfinkel@anl.gov> | 2015-07-15 08:23:05 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2015-07-15 08:23:05 +0000 |
commit | 5d36b230b5ea88cb6e06f604431f856808703969 (patch) | |
tree | 6aa71cd2555797b69368d5f38dceef8051bc7c5a /llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | |
parent | 673b493e9859dcb63ae035a4b1de0d3cc1cb0e1d (diff) | |
download | llvm-5d36b230b5ea88cb6e06f604431f856808703969.zip llvm-5d36b230b5ea88cb6e06f604431f856808703969.tar.gz llvm-5d36b230b5ea88cb6e06f604431f856808703969.tar.bz2 |
[PowerPC] Use the MachineCombiner to reassociate fadd/fmul
This is a direct port of the code from the X86 backend (r239486/r240361), which
uses the MachineCombiner to reassociate (floating-point) adds/muls to increase
ILP, to the PowerPC backend. The rationale is the same.
There is a lot of copy-and-paste here between the X86 code and the PowerPC
code, and we should extract at least some of this into CodeGen somewhere.
However, I don't want to do that until this code is enhanced to handle FMAs as
well. After that, we'll be in a better position to extract the common parts.
llvm-svn: 242279
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp index 1daf244..b602edb 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -57,6 +57,11 @@ EnableExtraTOCRegDeps("enable-ppc-extra-toc-reg-deps", cl::desc("Add extra TOC register dependencies"), cl::init(true), cl::Hidden); +static cl::opt<bool> +EnableMachineCombinerPass("ppc-machine-combiner", + cl::desc("Enable the machine combiner pass"), + cl::init(true), cl::Hidden); + extern "C" void LLVMInitializePowerPCTarget() { // Register the targets RegisterTargetMachine<PPC32TargetMachine> A(ThePPC32Target); @@ -316,6 +321,10 @@ bool PPCPassConfig::addPreISel() { bool PPCPassConfig::addILPOpts() { addPass(&EarlyIfConverterID); + + if (EnableMachineCombinerPass) + addPass(&MachineCombinerID); + return true; } |