mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-14 15:39:06 +00:00
mips16: When copying operands in a conditional branch instruction, allow for
immediate operands to be copied. Patch by Reed Kotler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163811 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0767dc546e
commit
e6ac7d69d3
@ -95,6 +95,7 @@ bool MipsInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,
|
|||||||
SmallVectorImpl<MachineOperand> &Cond,
|
SmallVectorImpl<MachineOperand> &Cond,
|
||||||
bool AllowModify) const
|
bool AllowModify) const
|
||||||
{
|
{
|
||||||
|
|
||||||
MachineBasicBlock::reverse_iterator I = MBB.rbegin(), REnd = MBB.rend();
|
MachineBasicBlock::reverse_iterator I = MBB.rbegin(), REnd = MBB.rend();
|
||||||
|
|
||||||
// Skip all the debug instructions.
|
// Skip all the debug instructions.
|
||||||
@ -177,9 +178,14 @@ void MipsInstrInfo::BuildCondBr(MachineBasicBlock &MBB,
|
|||||||
const MCInstrDesc &MCID = get(Opc);
|
const MCInstrDesc &MCID = get(Opc);
|
||||||
MachineInstrBuilder MIB = BuildMI(&MBB, DL, MCID);
|
MachineInstrBuilder MIB = BuildMI(&MBB, DL, MCID);
|
||||||
|
|
||||||
for (unsigned i = 1; i < Cond.size(); ++i)
|
for (unsigned i = 1; i < Cond.size(); ++i) {
|
||||||
|
if (Cond[i].isReg())
|
||||||
MIB.addReg(Cond[i].getReg());
|
MIB.addReg(Cond[i].getReg());
|
||||||
|
else if (Cond[i].isImm())
|
||||||
|
MIB.addImm(Cond[i].getImm());
|
||||||
|
else
|
||||||
|
assert(true && "Cannot copy operand");
|
||||||
|
}
|
||||||
MIB.addMBB(TBB);
|
MIB.addMBB(TBB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user