[llvm-commits] CVS: llvm/lib/CodeGen/MachineInstr.cpp

Chris Lattner sabre at nondot.org
Mon Nov 20 09:57:37 PST 2006



Changes in directory llvm/lib/CodeGen:

MachineInstr.cpp updated: 1.131 -> 1.132
---
Log message:

setOperand should not zap the operand list or add implicit operands to an 
instruction.  Doing so breaks the FP stackifier, the alpha branch selector
the sparc fpmover.

This fixes PR1012: http://llvm.org/PR1012  and CodeGen/X86/fp-stack-compare.ll


---
Diffs of the changes:  (+0 -39)

 MachineInstr.cpp |   39 ---------------------------------------
 1 files changed, 39 deletions(-)


Index: llvm/lib/CodeGen/MachineInstr.cpp
diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.131 llvm/lib/CodeGen/MachineInstr.cpp:1.132
--- llvm/lib/CodeGen/MachineInstr.cpp:1.131	Wed Nov 15 14:54:29 2006
+++ llvm/lib/CodeGen/MachineInstr.cpp	Mon Nov 20 11:57:22 2006
@@ -180,45 +180,6 @@
   }
 }
 
-/// setOpcode - Replace the opcode of the current instruction with a new one.
-///
-void MachineInstr::setOpcode(unsigned Op) {
-  Operands.erase(Operands.begin(), Operands.begin()+NumImplicitOps);
-  NumImplicitOps = 0;
-  Opcode = Op;
-  if (!getParent())
-    return;
-  const TargetInstrDescriptor &TID = getParent()->getParent()->
-    getTarget().getInstrInfo()->get(Op);
-  if (TID.ImplicitDefs)
-    for (const unsigned *ImpDefs = TID.ImplicitDefs; *ImpDefs; ++ImpDefs) {
-      MachineOperand Op;
-      Op.opType = MachineOperand::MO_Register;
-      Op.IsDef = true;
-      Op.IsImp = true;
-      Op.IsKill = false;
-      Op.IsDead = false;
-      Op.contents.RegNo = *ImpDefs;
-      Op.offset = 0;
-      Operands.insert(Operands.begin()+NumImplicitOps, Op);
-      NumImplicitOps++;
-    }
-  if (TID.ImplicitUses)
-    for (const unsigned *ImpUses = TID.ImplicitUses; *ImpUses; ++ImpUses) {
-      MachineOperand Op;
-      Op.opType = MachineOperand::MO_Register;
-      Op.IsDef = false;
-      Op.IsImp = true;
-      Op.IsKill = false;
-      Op.IsDead = false;
-      Op.contents.RegNo = *ImpUses;
-      Op.offset = 0;
-      Operands.insert(Operands.begin()+NumImplicitOps, Op);
-      NumImplicitOps++;
-    }
-}
-
-
 void MachineInstr::dump() const {
   std::cerr << "  " << *this;
 }






More information about the llvm-commits mailing list