[llvm-bugs] [Bug 34894] New: Deduplicate DEBUG and ORE diagnostics

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 9 16:10:18 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=34894

            Bug ID: 34894
           Summary: Deduplicate DEBUG and ORE diagnostics
           Product: tools
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: opt-viewer
          Assignee: unassignedbugs at nondot.org
          Reporter: anemet at apple.com
                CC: anemet at apple.com, llvm-bugs at lists.llvm.org

We have many places in the source where we duplicate diagnostics between
DEBUG(dbgs() << ...) and ORE.emit(...).  For example in
IndirectCallPromotion.cpp:

    if (ICPInvokeOnly && dyn_cast<CallInst>(Inst)) {
      DEBUG(dbgs() << " Not promote: User options.\n");
      ORE.emit(OptimizationRemarkMissed(DEBUG_TYPE, "UserOptions", Inst)
               << " Not promote: User options");
      break;
    }
    if (ICPCallOnly && dyn_cast<InvokeInst>(Inst)) {
      DEBUG(dbgs() << " Not promote: User option.\n");
      ORE.emit(OptimizationRemarkMissed(DEBUG_TYPE, "UserOptions", Inst)
               << " Not promote: User options");
      break;
    }
    if (ICPCutOff != 0 && NumOfPGOICallPromotion >= ICPCutOff) {
      DEBUG(dbgs() << " Not promote: Cutoff reached.\n");
      ORE.emit(OptimizationRemarkMissed(DEBUG_TYPE, "CutOffReached", Inst)
               << " Not promote: Cutoff reached");
      break;
    }

We should experiment with implying -pass-remarks*=<pass> with
-debug-only=<pass> and remove the DEBUG statements in favor of the ORE calls.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171009/f0a73379/attachment-0001.html>


More information about the llvm-bugs mailing list