diff options
author | Dan Gohman <gohman@apple.com> | 2008-12-09 22:45:08 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-12-09 22:45:08 +0000 |
commit | 9356d8f74db4ce20e244e1e14b671fe0c7d42e3d (patch) | |
tree | c6eb770f4f18c0116ff617f54723ff232f3b8252 /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | ea831ee11ca47817dc3436ddd8ae59e99d0488ba (diff) | |
download | bcm5719-llvm-9356d8f74db4ce20e244e1e14b671fe0c7d42e3d.tar.gz bcm5719-llvm-9356d8f74db4ce20e244e1e14b671fe0c7d42e3d.zip |
Minor code simplification.
llvm-svn: 60804
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 2cca6c07b1d..5fe10039207 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -406,6 +406,8 @@ void MachineInstr::addOperand(const MachineOperand &Op) { assert((isImpReg || !OperandsComplete()) && "Trying to add an operand to a machine instr that is already done!"); + MachineRegisterInfo *RegInfo = getRegInfo(); + // If we are adding the operand to the end of the list, our job is simpler. // This is true most of the time, so this is a reasonable optimization. if (isImpReg || NumImplicitOps == 0) { @@ -419,7 +421,7 @@ void MachineInstr::addOperand(const MachineOperand &Op) { // If the operand is a register, update the operand's use list. if (Op.isReg()) - Operands.back().AddRegOperandToRegInfo(getRegInfo()); + Operands.back().AddRegOperandToRegInfo(RegInfo); return; } } @@ -427,8 +429,6 @@ void MachineInstr::addOperand(const MachineOperand &Op) { // Otherwise, we have to insert a real operand before any implicit ones. unsigned OpNo = Operands.size()-NumImplicitOps; - MachineRegisterInfo *RegInfo = getRegInfo(); - // If this instruction isn't embedded into a function, then we don't need to // update any operand lists. if (RegInfo == 0) { |