[PowerPC] Use the MachineCombiner to reassociate fadd/fmul
authorHal Finkel <hfinkel@anl.gov>
Wed, 15 Jul 2015 08:23:05 +0000 (08:23 +0000)
committerHal Finkel <hfinkel@anl.gov>
Wed, 15 Jul 2015 08:23:05 +0000 (08:23 +0000)
commit8913d18fb1f694c7ea363a8f2ea002673d025202
tree131219fe154242665aa521eedad4197b24b48d14
parente4edd6cd8e21e3cc196a7310c3c6bf2826351c3f
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242279 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCInstrInfo.cpp
lib/Target/PowerPC/PPCInstrInfo.h
lib/Target/PowerPC/PPCTargetMachine.cpp
test/CodeGen/PowerPC/machine-combiner.ll [new file with mode: 0644]