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

llvm-svn: 1308
This commit is contained in:
Vikram S. Adve 2001-11-14 18:49:45 +00:00
parent 3baa8cefc0
commit a8f8fd19c0

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)