diff options
| author | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2018-09-18 13:21:58 +0000 |
|---|---|---|
| committer | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2018-09-18 13:21:58 +0000 |
| commit | 6a39d32e663ae1c19b4f01b191433f5c0f0cfc45 (patch) | |
| tree | 099cc9589fd582e81273db574a5baefd02eeb5d2 /llvm/lib/Target | |
| parent | 83d7414e196ae9e7a6c1721c6356b5f2e8dfc919 (diff) | |
| download | bcm5719-llvm-6a39d32e663ae1c19b4f01b191433f5c0f0cfc45.tar.gz bcm5719-llvm-6a39d32e663ae1c19b4f01b191433f5c0f0cfc45.zip | |
[PowerPC] Optimize compares fed by ANDISo
Both ANDIo and ANDISo (and the 64-bit versions) are record-form instructions.
When optimizing compares, we handle the former in order to eliminate the compare
instruction but not the latter. This patch just adds the latter to the set of
instructions we optimize.
The reason these instructions need to be handled separately is that they are not
part of the RecFormRel map (since they don't have a non-record-form). The
missing "and-immediate-shifted" is just an oversight in the initial
implementation.
Differential revision: https://reviews.llvm.org/D51353
llvm-svn: 342472
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp index 3e401981ccb..c3a280ad9ae 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp @@ -1822,7 +1822,8 @@ bool PPCInstrInfo::optimizeCompareInstr(MachineInstr &CmpInstr, unsigned SrcReg, int NewOpC = -1; int MIOpC = MI->getOpcode(); - if (MIOpC == PPC::ANDIo || MIOpC == PPC::ANDIo8) + if (MIOpC == PPC::ANDIo || MIOpC == PPC::ANDIo8 || + MIOpC == PPC::ANDISo || MIOpC == PPC::ANDISo8) NewOpC = MIOpC; else { NewOpC = PPC::getRecordFormOpcode(MIOpC); |

