Convert DOUT to DEBUG(errs()...).

llvm-svn: 79753
This commit is contained in:
Bill Wendling 2009-08-22 20:23:49 +00:00
parent dfcc42fa39
commit 8d64226efe
1 changed files with 27 additions and 30 deletions

View File

@ -121,7 +121,7 @@ bool LowerSubregsInstructionPass::LowerExtract(MachineInstr *MI) {
"Extract destination must be in a physical register");
assert(SrcReg && "invalid subregister index for register");
DOUT << "subreg: CONVERTING: " << *MI;
DEBUG(errs() << "subreg: CONVERTING: " << *MI);
if (SrcReg == DstReg) {
// No need to insert an identity copy instruction.
@ -130,10 +130,11 @@ bool LowerSubregsInstructionPass::LowerExtract(MachineInstr *MI) {
// instruction with IMPLICIT_DEF.
MI->setDesc(TII.get(TargetInstrInfo::IMPLICIT_DEF));
MI->RemoveOperand(2); // SubIdx
DOUT << "subreg: replace by: " << *MI;
DEBUG(errs() << "subreg: replace by: " << *MI);
return true;
}
DOUT << "subreg: eliminated!";
DEBUG(errs() << "subreg: eliminated!");
} else {
// Insert copy
const TargetRegisterClass *TRCS = TRI.getPhysicalRegisterRegClass(DstReg);
@ -146,14 +147,13 @@ bool LowerSubregsInstructionPass::LowerExtract(MachineInstr *MI) {
TransferDeadFlag(MI, DstReg, TRI);
if (MI->getOperand(1).isKill())
TransferKillFlag(MI, SuperReg, TRI, true);
#ifndef NDEBUG
MachineBasicBlock::iterator dMI = MI;
DOUT << "subreg: " << *(--dMI);
#endif
DEBUG({
MachineBasicBlock::iterator dMI = MI;
errs() << "subreg: " << *(--dMI);
});
}
DOUT << "\n";
DEBUG(errs() << '\n');
MBB->erase(MI);
return true;
}
@ -181,7 +181,7 @@ bool LowerSubregsInstructionPass::LowerSubregToReg(MachineInstr *MI) {
assert(TargetRegisterInfo::isPhysicalRegister(InsReg) &&
"Inserted value must be in a physical register");
DOUT << "subreg: CONVERTING: " << *MI;
DEBUG(errs() << "subreg: CONVERTING: " << *MI);
if (DstSubReg == InsReg && InsSIdx == 0) {
// No need to insert an identify copy instruction.
@ -190,7 +190,7 @@ bool LowerSubregsInstructionPass::LowerSubregToReg(MachineInstr *MI) {
// %RAX<def> = SUBREG_TO_REG 0, %EAX:3<kill>, 3
// The first def is defining RAX, not EAX so the top bits were not
// zero extended.
DOUT << "subreg: eliminated!";
DEBUG(errs() << "subreg: eliminated!");
} else {
// Insert sub-register copy
const TargetRegisterClass *TRC0= TRI.getPhysicalRegisterRegClass(DstSubReg);
@ -201,14 +201,13 @@ bool LowerSubregsInstructionPass::LowerSubregToReg(MachineInstr *MI) {
TransferDeadFlag(MI, DstSubReg, TRI);
if (MI->getOperand(2).isKill())
TransferKillFlag(MI, InsReg, TRI);
#ifndef NDEBUG
MachineBasicBlock::iterator dMI = MI;
DOUT << "subreg: " << *(--dMI);
#endif
DEBUG({
MachineBasicBlock::iterator dMI = MI;
errs() << "subreg: " << *(--dMI);
});
}
DOUT << "\n";
DEBUG(errs() << '\n');
MBB->erase(MI);
return true;
}
@ -239,7 +238,7 @@ bool LowerSubregsInstructionPass::LowerInsert(MachineInstr *MI) {
assert(TargetRegisterInfo::isPhysicalRegister(InsReg) &&
"Inserted value must be in a physical register");
DOUT << "subreg: CONVERTING: " << *MI;
DEBUG(errs() << "subreg: CONVERTING: " << *MI);
if (DstSubReg == InsReg) {
// No need to insert an identity copy instruction. If the SrcReg was
@ -252,7 +251,7 @@ bool LowerSubregsInstructionPass::LowerInsert(MachineInstr *MI) {
else
MIB.addReg(InsReg, RegState::ImplicitKill);
} else {
DOUT << "subreg: eliminated!\n";
DEBUG(errs() << "subreg: eliminated!\n");
MBB->erase(MI);
return true;
}
@ -287,12 +286,11 @@ bool LowerSubregsInstructionPass::LowerInsert(MachineInstr *MI) {
TransferKillFlag(MI, InsReg, TRI);
}
#ifndef NDEBUG
MachineBasicBlock::iterator dMI = MI;
DOUT << "subreg: " << *(--dMI);
#endif
DEBUG({
MachineBasicBlock::iterator dMI = MI;
errs() << "subreg: " << *(--dMI) << "\n";
});
DOUT << "\n";
MBB->erase(MI);
return true;
}
@ -301,13 +299,12 @@ bool LowerSubregsInstructionPass::LowerInsert(MachineInstr *MI) {
/// copies.
///
bool LowerSubregsInstructionPass::runOnMachineFunction(MachineFunction &MF) {
DOUT << "Machine Function\n";
bool MadeChange = false;
DEBUG(errs() << "Machine Function\n"
<< "********** LOWERING SUBREG INSTRS **********\n"
<< "********** Function: "
<< MF.getFunction()->getName() << '\n');
DOUT << "********** LOWERING SUBREG INSTRS **********\n";
DEBUG(errs() << "********** Function: "
<< MF.getFunction()->getName() << '\n');
bool MadeChange = false;
for (MachineFunction::iterator mbbi = MF.begin(), mbbe = MF.end();
mbbi != mbbe; ++mbbi) {