diff options
Diffstat (limited to 'llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp b/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp index d2e2e27f397..072b64474f7 100644 --- a/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp +++ b/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp @@ -530,10 +530,20 @@ static unsigned getConditionalMove(unsigned Opcode) { } } +static unsigned getConditionalLoadImmediate(unsigned Opcode) { + switch (Opcode) { + case SystemZ::LHI: return SystemZ::LOCHI; + case SystemZ::LGHI: return SystemZ::LOCGHI; + default: return 0; + } +} + bool SystemZInstrInfo::isPredicable(MachineInstr &MI) const { unsigned Opcode = MI.getOpcode(); if (STI.hasLoadStoreOnCond() && getConditionalMove(Opcode)) return true; + if (STI.hasLoadStoreOnCond2() && getConditionalLoadImmediate(Opcode)) + return true; if (Opcode == SystemZ::Return || Opcode == SystemZ::Trap || Opcode == SystemZ::CallJG || @@ -595,6 +605,16 @@ bool SystemZInstrInfo::PredicateInstruction( return true; } } + if (STI.hasLoadStoreOnCond2()) { + if (unsigned CondOpcode = getConditionalLoadImmediate(Opcode)) { + MI.setDesc(get(CondOpcode)); + MachineInstrBuilder(*MI.getParent()->getParent(), MI) + .addImm(CCValid) + .addImm(CCMask) + .addReg(SystemZ::CC, RegState::Implicit); + return true; + } + } if (Opcode == SystemZ::Trap) { MI.setDesc(get(SystemZ::CondTrap)); MachineInstrBuilder(*MI.getParent()->getParent(), MI) |