Inline a variable into debug section to fix unused variable warning.
authorRichard Trieu <rtrieu@google.com>
Wed, 29 May 2019 04:09:32 +0000 (04:09 +0000)
committerRichard Trieu <rtrieu@google.com>
Wed, 29 May 2019 04:09:32 +0000 (04:09 +0000)
llvm-svn: 361927

llvm/lib/CodeGen/MachinePipeliner.cpp

index 61441d9..af159f1 100644 (file)
@@ -3963,10 +3963,10 @@ void ResourceManager::reserveResources(const MCInstrDesc *MID) {
                   STI->getWriteProcResEnd(SCDesc))) {
     if (!PRE.Cycles)
       continue;
-    const MCProcResourceDesc *ProcResource =
-        SM.getProcResource(PRE.ProcResourceIdx);
     ++ProcResourceCount[PRE.ProcResourceIdx];
     LLVM_DEBUG({
+      const MCProcResourceDesc *ProcResource =
+          SM.getProcResource(PRE.ProcResourceIdx);
       dbgs() << format(" %16s(%2d): Count: %2d, NumUnits:%2d, Cycles:%2d\n",
                        ProcResource->Name, PRE.ProcResourceIdx,
                        ProcResourceCount[PRE.ProcResourceIdx],