OSDN Git Service

[PowerPC] Convert r+r instructions to r+i (pre and post RA)
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Fri, 15 Dec 2017 07:27:53 +0000 (07:27 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Fri, 15 Dec 2017 07:27:53 +0000 (07:27 +0000)
commit01cfc43fe473b6cac0e01795556324dbef4388fc
tree5ef7373e9074aa134ba680262ac678093d353c16
parentd077c9767cdcf039217726503664e5103c358df5
[PowerPC] Convert r+r instructions to r+i (pre and post RA)

This patch adds the necessary infrastructure to convert instructions that
take two register operands to those that take a register and immediate if
the necessary operand is produced by a load-immediate. Furthermore, it uses
this infrastructure to perform such conversions twice - first at MachineSSA
and then pre-emit.

There are a number of reasons we may end up with opportunities for this
transformation, including but not limited to:
- X-Form instructions chosen since the exact offset isn't available at ISEL time
- Atomic instructions with constant operands (we will add patterns for this
  in the future)
- Tail duplication may duplicate code where one block contains this redundancy
- When emitting compare-free code in PPCDAGToDAGISel, we don't handle constant
  comparands specially

Furthermore, this patch moves the initialization of PPCMIPeepholePass so that
it can be used for MIR tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320791 91177308-0d34-0410-b5e6-96231b3b80d8
17 files changed:
lib/Target/PowerPC/CMakeLists.txt
lib/Target/PowerPC/PPC.h
lib/Target/PowerPC/PPCInstr64Bit.td
lib/Target/PowerPC/PPCInstrInfo.cpp
lib/Target/PowerPC/PPCInstrInfo.h
lib/Target/PowerPC/PPCInstrInfo.td
lib/Target/PowerPC/PPCMIPeephole.cpp
lib/Target/PowerPC/PPCPreEmitPeephole.cpp [new file with mode: 0644]
lib/Target/PowerPC/PPCTargetMachine.cpp
test/CodeGen/PowerPC/build-vector-tests.ll
test/CodeGen/PowerPC/convert-rr-to-ri-instrs-R0-special-handling.mir [new file with mode: 0644]
test/CodeGen/PowerPC/convert-rr-to-ri-instrs.mir [new file with mode: 0644]
test/CodeGen/PowerPC/fast-isel-call.ll
test/CodeGen/PowerPC/setcc-logic.ll
test/CodeGen/PowerPC/simplifyConstCmpToISEL.ll [new file with mode: 0644]
test/CodeGen/PowerPC/unaligned.ll
test/CodeGen/PowerPC/variable_elem_vec_extracts.ll