mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 06:32:24 +00:00
Fixed a FuseTwoAddrInst() bug: consider GlobalAddress and JumpTableIndex
in addition to immediate operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30205 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0c5b8dac79
commit
6f34b43292
@ -169,12 +169,17 @@ static MachineInstr *FuseTwoAddrInst(unsigned Opcode, unsigned FrameIndex,
|
|||||||
|
|
||||||
// Loop over the rest of the ri operands, converting them over.
|
// Loop over the rest of the ri operands, converting them over.
|
||||||
for (unsigned i = 0; i != NumOps; ++i) {
|
for (unsigned i = 0; i != NumOps; ++i) {
|
||||||
if (MI->getOperand(i+2).isReg())
|
MachineOperand &MO = MI->getOperand(i+2);
|
||||||
MIB = MIB.addReg(MI->getOperand(i+2).getReg());
|
if (MO.isReg())
|
||||||
else {
|
MIB = MIB.addReg(MO.getReg());
|
||||||
assert(MI->getOperand(i+2).isImm() && "Unknown operand type!");
|
else if (MO.isImm())
|
||||||
MIB = MIB.addImm(MI->getOperand(i+2).getImm());
|
MIB = MIB.addImm(MO.getImm());
|
||||||
}
|
else if (MO.isGlobalAddress())
|
||||||
|
MIB = MIB.addGlobalAddress(MO.getGlobal(), MO.getOffset());
|
||||||
|
else if (MO.isJumpTableIndex())
|
||||||
|
MIB = MIB.addJumpTableIndex(MO.getJumpTableIndex());
|
||||||
|
else
|
||||||
|
assert(0 && "Unknown operand type!");
|
||||||
}
|
}
|
||||||
return MIB;
|
return MIB;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user