diff options
author | Chris Lattner <sabre@nondot.org> | 2003-01-15 18:11:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-01-15 18:11:11 +0000 |
commit | 4690e6d42f7289793b87a9f3f54c751b0ac83705 (patch) | |
tree | d2908868d47a1e441fdd1c5f18aa9cf39758d888 | |
parent | f6ee49fcf0ac86d3b39376939fe731b34c9ae6cb (diff) |
Fix bug found by regtests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5294 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/SparcV9/SparcV9InstrSelection.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp index 05208a4a21..1e0a82d83b 100644 --- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp +++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp @@ -1251,18 +1251,14 @@ GetInstructionsByRule(InstructionNode* subtreeRoot, Instruction* returnReg = new TmpInstruction(returnInstr); MachineCodeForInstruction::get(returnInstr).addTemp(returnReg); - M = new MachineInstr(JMPLRET); - M->SetMachineOperandVal(0, MachineOperand::MO_VirtualRegister, - returnReg); - M->SetMachineOperandConst(1,MachineOperand::MO_SignExtendedImmed, - (int64_t)8); - M->SetMachineOperandReg(2, target.getRegInfo().getZeroRegNum()); + M = BuildMI(JMPLRET, 3).addReg(returnReg).addSImm(8) + .addMReg(target.getRegInfo().getZeroRegNum(), MOTy::Def); if (returnInstr->getReturnValue() != NULL) M->addImplicitRef(returnInstr->getReturnValue()); mvec.push_back(M); - mvec.push_back(new MachineInstr(NOP)); + mvec.push_back(BuildMI(NOP, 0)); break; } @@ -1998,8 +1994,8 @@ GetInstructionsByRule(InstructionNode* subtreeRoot, if (isa<Function>(callee)) // direct function call M = BuildMI(CALL, 1).addPCDisp(callee); else // indirect function call - M = BuildMI(JMPLCALL, - 3).addReg(callee).addSImm((int64_t)0).addReg(retAddrReg); + M = BuildMI(JMPLCALL, 3).addReg(callee).addSImm((int64_t)0) + .addRegDef(retAddrReg); mvec.push_back(M); const FunctionType* funcType = |