[llvm] r270459 - [Hexagon] Move some debug-only variable declarations into DEBUG
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Mon May 23 10:31:59 PDT 2016
Author: kparzysz
Date: Mon May 23 12:31:30 2016
New Revision: 270459
URL: http://llvm.org/viewvc/llvm-project?rev=270459&view=rev
Log:
[Hexagon] Move some debug-only variable declarations into DEBUG
Modified:
llvm/trunk/lib/Target/Hexagon/HexagonOptAddrMode.cpp
Modified: llvm/trunk/lib/Target/Hexagon/HexagonOptAddrMode.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonOptAddrMode.cpp?rev=270459&r1=270458&r2=270459&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonOptAddrMode.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonOptAddrMode.cpp Mon May 23 12:31:30 2016
@@ -144,10 +144,11 @@ MachineInstr *HexagonOptAddrMode::getRea
}
if (HasReachingDef) {
NodeAddr<DefNode *> RDN = DFG->addr<DefNode *>(RD);
- NodeAddr<StmtNode *> ReachingIA = RDN.Addr->getOwner(*DFG);
- DEBUG(dbgs() << "\t\t\t[Def Node]: "
- << Print<NodeAddr<InstrNode *>>(ReachingIA, *DFG) << "\n");
- (void)ReachingIA;
+ DEBUG({
+ NodeAddr<StmtNode *> ReachingIA = RDN.Addr->getOwner(*DFG);
+ dbgs() << "\t\t\t[Def Node]: "
+ << Print<NodeAddr<InstrNode *>>(ReachingIA, *DFG) << "\n";
+ });
NodeId ReachedID = RDN.Addr->getReachedDef();
if (!ReachedID)
return ReachedDefMI;
@@ -231,14 +232,15 @@ bool HexagonOptAddrMode::allValidCandida
NodeSet Visited, Defs;
const auto &ReachingDefs = LV->getAllReachingDefsRec(UR, UN, Visited, Defs);
if (ReachingDefs.size() > 1) {
- DEBUG(dbgs() << "*** Multiple Reaching Defs found!!! *** \n");
- for (auto DI : ReachingDefs) {
- NodeAddr<UseNode *> DA = DFG->addr<UseNode *>(DI);
- NodeAddr<StmtNode *> TempIA = DA.Addr->getOwner(*DFG);
- (void)TempIA;
- DEBUG(dbgs() << "\t\t[Reaching Def]: "
- << Print<NodeAddr<InstrNode *>>(TempIA, *DFG) << "\n");
- }
+ DEBUG({
+ dbgs() << "*** Multiple Reaching Defs found!!! ***\n";
+ for (auto DI : ReachingDefs) {
+ NodeAddr<UseNode *> DA = DFG->addr<UseNode *>(DI);
+ NodeAddr<StmtNode *> TempIA = DA.Addr->getOwner(*DFG);
+ dbgs() << "\t\t[Reaching Def]: "
+ << Print<NodeAddr<InstrNode *>>(TempIA, *DFG) << "\n";
+ }
+ });
return false;
}
}
@@ -255,10 +257,11 @@ void HexagonOptAddrMode::getAllRealUses(
for (auto UI : UseSet) {
NodeAddr<UseNode *> UA = DFG->addr<UseNode *>(UI);
- NodeAddr<StmtNode *> TempIA = UA.Addr->getOwner(*DFG);
- (void)TempIA;
- DEBUG(dbgs() << "\t\t\t[Reached Use]: "
- << Print<NodeAddr<InstrNode *>>(TempIA, *DFG) << "\n");
+ DEBUG({
+ NodeAddr<StmtNode *> TempIA = UA.Addr->getOwner(*DFG);
+ dbgs() << "\t\t\t[Reached Use]: "
+ << Print<NodeAddr<InstrNode *>>(TempIA, *DFG) << "\n";
+ });
if (UA.Addr->getFlags() & NodeAttrs::PhiRef) {
NodeAddr<PhiNode *> PA = UA.Addr->getOwner(*DFG);
@@ -582,9 +585,8 @@ bool HexagonOptAddrMode::processBlock(No
NodeAddr<StmtNode *> OwnerN = UseN.Addr->getOwner(*DFG);
MachineInstr *UseMI = OwnerN.Addr->getCode();
- unsigned BBNum = UseMI->getParent()->getNumber();
- (void)BBNum;
- DEBUG(dbgs() << "\t\t[MI <BB#" << BBNum << ">]: " << *UseMI << "\n");
+ DEBUG(dbgs() << "\t\t[MI <BB#" << UseMI->getParent()->getNumber()
+ << ">]: " << *UseMI << "\n");
int UseMOnum = -1;
unsigned NumOperands = UseMI->getNumOperands();
More information about the llvm-commits
mailing list