diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2003-06-03 03:18:20 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2003-06-03 03:18:20 +0000 |
commit | 0cf667165e3ef60ef12ac2e78f3f552c0861acdb (patch) | |
tree | 95d319dcbb1d21249ec4a32e5a23bef0d9cdeeae /llvm/lib/CodeGen | |
parent | bbd10f96a2a0a9a6814903f045b2e701fa6a9587 (diff) | |
download | bcm5719-llvm-0cf667165e3ef60ef12ac2e78f3f552c0861acdb.tar.gz bcm5719-llvm-0cf667165e3ef60ef12ac2e78f3f552c0861acdb.zip |
Moved code to modify the opcode from 'reg' to 'imm' form to a more logical place.
llvm-svn: 6563
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp b/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp index 268fb3d877c..f654e90100b 100644 --- a/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp +++ b/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp @@ -186,12 +186,6 @@ FixConstantOperandsForInstr(Instruction* vmInstr, immedValue); if (opType == MachineOperand::MO_VirtualRegister) constantThatMustBeLoaded = true; - else { - // The optype has changed from being a register to an immediate - // This means we need to change the opcode, e.g. ADDr -> ADDi - unsigned newOpcode = convertOpcodeFromRegToImm(opCode); - minstr->setOpcode(newOpcode); - } } } else @@ -219,21 +213,18 @@ FixConstantOperandsForInstr(Instruction* vmInstr, ? (Value*)ConstantSInt::get(Type::LongTy, immedValue) : (Value*)ConstantUInt::get(Type::ULongTy,(uint64_t)immedValue); } - else - { - // The optype has changed from being a register to an immediate - // This means we need to change the opcode, e.g. ADDr -> ADDi - unsigned newOpcode = convertOpcodeFromRegToImm(opCode); - minstr->setOpcode(newOpcode); - } } if (opType == MachineOperand::MO_MachineRegister) minstr->SetMachineOperandReg(op, machineRegNum); else if (opType == MachineOperand::MO_SignExtendedImmed || - opType == MachineOperand::MO_UnextendedImmed) + opType == MachineOperand::MO_UnextendedImmed) { minstr->SetMachineOperandConst(op, opType, immedValue); - else if (constantThatMustBeLoaded || + // The optype has changed from being a register to an immediate + // This means we need to change the opcode, e.g. ADDr -> ADDi + unsigned newOpcode = convertOpcodeFromRegToImm(opCode); + minstr->setOpcode(newOpcode); + } else if (constantThatMustBeLoaded || (opValue && isa<GlobalValue>(opValue))) { // opValue is a constant that must be explicitly loaded into a reg assert(opValue); |