mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-10 12:32:21 +00:00
Revert. This wasn't meant to be checked in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31737 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
26e552b04c
commit
3cdd9f65ed
@ -40,7 +40,6 @@
|
|||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Support/Compiler.h"
|
#include "llvm/Support/Compiler.h"
|
||||||
#include "llvm/ADT/DepthFirstIterator.h"
|
#include "llvm/ADT/DepthFirstIterator.h"
|
||||||
#include "llvm/ADT/SmallVector.h"
|
|
||||||
#include "llvm/ADT/Statistic.h"
|
#include "llvm/ADT/Statistic.h"
|
||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -214,12 +213,20 @@ bool FPS::processBasicBlock(MachineFunction &MF, MachineBasicBlock &BB) {
|
|||||||
|
|
||||||
// Get dead variables list now because the MI pointer may be deleted as part
|
// Get dead variables list now because the MI pointer may be deleted as part
|
||||||
// of processing!
|
// of processing!
|
||||||
SmallVector<unsigned, 8> DeadRegs;
|
LiveVariables::killed_iterator IB, IE;
|
||||||
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
|
tie(IB, IE) = LV->dead_range(MI);
|
||||||
const MachineOperand &MO = MI->getOperand(i);
|
|
||||||
if (MO.isReg() && MO.isDead())
|
DEBUG(
|
||||||
DeadRegs.push_back(MO.getReg());
|
const MRegisterInfo *MRI = MF.getTarget().getRegisterInfo();
|
||||||
}
|
LiveVariables::killed_iterator I = LV->killed_begin(MI);
|
||||||
|
LiveVariables::killed_iterator E = LV->killed_end(MI);
|
||||||
|
if (I != E) {
|
||||||
|
std::cerr << "Killed Operands:";
|
||||||
|
for (; I != E; ++I)
|
||||||
|
std::cerr << " %" << MRI->getName(*I);
|
||||||
|
std::cerr << "\n";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
switch (Flags & X86II::FPTypeMask) {
|
switch (Flags & X86II::FPTypeMask) {
|
||||||
case X86II::ZeroArgFP: handleZeroArgFP(I); break;
|
case X86II::ZeroArgFP: handleZeroArgFP(I); break;
|
||||||
@ -234,8 +241,8 @@ bool FPS::processBasicBlock(MachineFunction &MF, MachineBasicBlock &BB) {
|
|||||||
|
|
||||||
// Check to see if any of the values defined by this instruction are dead
|
// Check to see if any of the values defined by this instruction are dead
|
||||||
// after definition. If so, pop them.
|
// after definition. If so, pop them.
|
||||||
for (unsigned i = 0, e = DeadRegs.size(); i != e; ++i) {
|
for (; IB != IE; ++IB) {
|
||||||
unsigned Reg = DeadRegs[i];
|
unsigned Reg = *IB;
|
||||||
if (Reg >= X86::FP0 && Reg <= X86::FP6) {
|
if (Reg >= X86::FP0 && Reg <= X86::FP6) {
|
||||||
DEBUG(std::cerr << "Register FP#" << Reg-X86::FP0 << " is dead!\n");
|
DEBUG(std::cerr << "Register FP#" << Reg-X86::FP0 << " is dead!\n");
|
||||||
freeStackSlotAfter(I, Reg-X86::FP0);
|
freeStackSlotAfter(I, Reg-X86::FP0);
|
||||||
@ -755,7 +762,6 @@ void FPS::handleCondMovFP(MachineBasicBlock::iterator &I) {
|
|||||||
|
|
||||||
unsigned Op0 = getFPReg(MI->getOperand(0));
|
unsigned Op0 = getFPReg(MI->getOperand(0));
|
||||||
unsigned Op1 = getFPReg(MI->getOperand(2));
|
unsigned Op1 = getFPReg(MI->getOperand(2));
|
||||||
bool KillsOp1 = LV->KillsRegister(MI, X86::FP0+Op1);
|
|
||||||
|
|
||||||
// The first operand *must* be on the top of the stack.
|
// The first operand *must* be on the top of the stack.
|
||||||
moveToTop(Op0, I);
|
moveToTop(Op0, I);
|
||||||
@ -767,8 +773,9 @@ void FPS::handleCondMovFP(MachineBasicBlock::iterator &I) {
|
|||||||
MI->getOperand(0).setReg(getSTReg(Op1));
|
MI->getOperand(0).setReg(getSTReg(Op1));
|
||||||
MI->setOpcode(getConcreteOpcode(MI->getOpcode()));
|
MI->setOpcode(getConcreteOpcode(MI->getOpcode()));
|
||||||
|
|
||||||
|
|
||||||
// If we kill the second operand, make sure to pop it from the stack.
|
// If we kill the second operand, make sure to pop it from the stack.
|
||||||
if (Op0 != Op1 && KillsOp1) {
|
if (Op0 != Op1 && LV->KillsRegister(MI, X86::FP0+Op1)) {
|
||||||
// Get this value off of the register stack.
|
// Get this value off of the register stack.
|
||||||
freeStackSlotAfter(I, Op1);
|
freeStackSlotAfter(I, Op1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user