diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-11-14 18:49:45 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2001-11-14 18:49:45 +0000 |
commit | cba86d060b51f2c7bcb56714ed682816cdbe1618 (patch) | |
tree | 92e2668409c90ac442c88f3af65ef6d0e92e344d /llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp | |
parent | 7e833073e325894c94681086b779623d194a8ce9 (diff) | |
download | bcm5719-llvm-cba86d060b51f2c7bcb56714ed682816cdbe1618.tar.gz bcm5719-llvm-cba86d060b51f2c7bcb56714ed682816cdbe1618.zip |
Don't assume constant operand can only be in position 1!
llvm-svn: 1308
Diffstat (limited to 'llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp')
-rw-r--r-- | llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp b/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp index c7d4260087b..853fe0f3108 100644 --- a/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp +++ b/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp @@ -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) |