diff options
author | Chris Lattner <sabre@nondot.org> | 2006-11-20 17:57:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-11-20 17:57:22 +0000 |
commit | 539df43e4b2cf82a02f2c4f8e34c1c081603c979 (patch) | |
tree | 5e821dfbeea6faa4da99ee64cc4ee90ff345cd3a /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 2ae12307649b4a40789a3e7e4074b12f5375c6e1 (diff) | |
download | bcm5719-llvm-539df43e4b2cf82a02f2c4f8e34c1c081603c979.tar.gz bcm5719-llvm-539df43e4b2cf82a02f2c4f8e34c1c081603c979.zip |
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 and CodeGen/X86/fp-stack-compare.ll
llvm-svn: 31876
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 41e2cdfe83b..16e235a679b 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -180,45 +180,6 @@ bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const { } } -/// 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; } |