diff --git a/lib/Target/X86/FloatingPoint.cpp b/lib/Target/X86/FloatingPoint.cpp index ab6d77b77dd..a56e071cf14 100644 --- a/lib/Target/X86/FloatingPoint.cpp +++ b/lib/Target/X86/FloatingPoint.cpp @@ -638,6 +638,9 @@ void FPS::handleCompareFP(MachineBasicBlock::iterator &I) { // anywhere. moveToTop(Op0, I); + MI->getOperand(0).setReg(getSTReg(Op1)); + MI->RemoveOperand(1); + // If any of the operands are killed by this instruction, free them. if (KillsOp0) freeStackSlotAfter(I, Op0); if (KillsOp1 && Op0 != Op1) freeStackSlotAfter(I, Op1); diff --git a/lib/Target/X86/X86FloatingPoint.cpp b/lib/Target/X86/X86FloatingPoint.cpp index ab6d77b77dd..a56e071cf14 100644 --- a/lib/Target/X86/X86FloatingPoint.cpp +++ b/lib/Target/X86/X86FloatingPoint.cpp @@ -638,6 +638,9 @@ void FPS::handleCompareFP(MachineBasicBlock::iterator &I) { // anywhere. moveToTop(Op0, I); + MI->getOperand(0).setReg(getSTReg(Op1)); + MI->RemoveOperand(1); + // If any of the operands are killed by this instruction, free them. if (KillsOp0) freeStackSlotAfter(I, Op0); if (KillsOp1 && Op0 != Op1) freeStackSlotAfter(I, Op1);