diff options
author | QingShan Zhang <qshanz@cn.ibm.com> | 2018-06-19 06:54:51 +0000 |
---|---|---|
committer | QingShan Zhang <qshanz@cn.ibm.com> | 2018-06-19 06:54:51 +0000 |
commit | 9f0fe9a3f86d4c3afd7dc765a28eadf6ae522135 (patch) | |
tree | ec30d1bb2da1f0dc42c3de3806585d2b5c83414d /llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | |
parent | ec03fbe8bbc4f00bd71d45cf617f9412ef984ada (diff) | |
download | bcm5719-llvm-9f0fe9a3f86d4c3afd7dc765a28eadf6ae522135.tar.gz bcm5719-llvm-9f0fe9a3f86d4c3afd7dc765a28eadf6ae522135.zip |
If the arch is P9, we will select the DFLOADf32/DFLOADf64 pseudo instruction when we are loading a floating,
and expand it post RA basing on the register pressure. However, we miss to do the add-imm peephole for these pseudo instruction.
Differential Revision: https://reviews.llvm.org/D47568
Reviewed By: Nemanjai
llvm-svn: 335024
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp index 655114b07f1..540d6932004 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp @@ -2065,6 +2065,12 @@ bool PPCInstrInfo::expandVSXMemPseudo(MachineInstr &MI) const { return true; } +#ifndef NDEBUG +static bool isAnImmediateOperand(const MachineOperand &MO) { + return MO.isCPI() || MO.isGlobal() || MO.isImm(); +} +#endif + bool PPCInstrInfo::expandPostRAPseudo(MachineInstr &MI) const { auto &MBB = *MI.getParent(); auto DL = MI.getDebugLoc(); @@ -2087,7 +2093,8 @@ bool PPCInstrInfo::expandPostRAPseudo(MachineInstr &MI) const { case PPC::DFSTOREf64: { assert(Subtarget.hasP9Vector() && "Invalid D-Form Pseudo-ops on Pre-P9 target."); - assert(MI.getOperand(2).isReg() && MI.getOperand(1).isImm() && + assert(MI.getOperand(2).isReg() && + isAnImmediateOperand(MI.getOperand(1)) && "D-form op must have register and immediate operands"); return expandVSXMemPseudo(MI); } |