[llvm-commits] [llvm] r79753 - /llvm/trunk/lib/CodeGen/LowerSubregs.cpp
Bill Wendling
isanbard at gmail.com
Sat Aug 22 13:23:49 PDT 2009
Author: void
Date: Sat Aug 22 15:23:49 2009
New Revision: 79753
URL: http://llvm.org/viewvc/llvm-project?rev=79753&view=rev
Log:
Convert DOUT to DEBUG(errs()...).
Modified:
llvm/trunk/lib/CodeGen/LowerSubregs.cpp
Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LowerSubregs.cpp?rev=79753&r1=79752&r2=79753&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LowerSubregs.cpp (original)
+++ llvm/trunk/lib/CodeGen/LowerSubregs.cpp Sat Aug 22 15:23:49 2009
@@ -121,7 +121,7 @@
"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 @@
// 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 @@
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 @@
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 @@
// %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 @@
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 @@
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 @@
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 @@
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 @@
/// 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) {
More information about the llvm-commits
mailing list