[llvm-commits] [llvm] r60804 - /llvm/trunk/lib/CodeGen/MachineInstr.cpp
Dan Gohman
gohman at apple.com
Tue Dec 9 14:45:08 PST 2008
Author: djg
Date: Tue Dec 9 16:45:08 2008
New Revision: 60804
URL: http://llvm.org/viewvc/llvm-project?rev=60804&view=rev
Log:
Minor code simplification.
Modified:
llvm/trunk/lib/CodeGen/MachineInstr.cpp
Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=60804&r1=60803&r2=60804&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Tue Dec 9 16:45:08 2008
@@ -406,6 +406,8 @@
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 @@
// 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 @@
// 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) {
More information about the llvm-commits
mailing list