Don't assume constant operand can only be in position 1!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1308 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vikram S. Adve 2001-11-14 18:49:45 +00:00
parent 4c5fe2d3ed
commit ecd5813639
2 changed files with 4 additions and 4 deletions

View File

@ -333,9 +333,9 @@ FixConstantOperandsForInstr(Instruction* vmInstr,
int64_t immedValue;
MachineOperand::MachineOperandType opType =
ChooseRegOrImmed(opValue, minstr->getOpCode(), target,
/*canUseImmed*/ (op == 1),
(target.getInstrInfo().getImmmedConstantPos(minstr->getOpCode()) == (int) op),
machineRegNum, immedValue);
if (opType == MachineOperand::MO_MachineRegister)
minstr->SetMachineOperand(op, machineRegNum);
else if (opType == MachineOperand::MO_VirtualRegister)

View File

@ -333,9 +333,9 @@ FixConstantOperandsForInstr(Instruction* vmInstr,
int64_t immedValue;
MachineOperand::MachineOperandType opType =
ChooseRegOrImmed(opValue, minstr->getOpCode(), target,
/*canUseImmed*/ (op == 1),
(target.getInstrInfo().getImmmedConstantPos(minstr->getOpCode()) == (int) op),
machineRegNum, immedValue);
if (opType == MachineOperand::MO_MachineRegister)
minstr->SetMachineOperand(op, machineRegNum);
else if (opType == MachineOperand::MO_VirtualRegister)