[PATCH] D51193: [PGO] Print target md5sum in missed optimization message

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 23 15:46:28 PDT 2018


davidxl created this revision.
davidxl added a reviewer: xur.

This is helpful for performance debugging. Ideally, the target name should be dumped, but creating instprof symtab for this purpose is expensive. A user can always use other ways to find the name (e.g, dumping the object symtab and compute the md5 hash for the mapping).  The later can also be a feature added to llvm-profdata.


https://reviews.llvm.org/D51193

Files:
  lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
  test/Transforms/PGOProfile/icp_mismatch_msg.ll


Index: test/Transforms/PGOProfile/icp_mismatch_msg.ll
===================================================================
--- test/Transforms/PGOProfile/icp_mismatch_msg.ll
+++ test/Transforms/PGOProfile/icp_mismatch_msg.ll
@@ -2,7 +2,7 @@
 ; RUN: opt < %s -passes=pgo-icall-prom -pass-remarks-missed=pgo-icall-prom -S 2>& 1 | FileCheck %s
 
 ; CHECK: remark: <unknown>:0:0: Cannot promote indirect call to func4 with count of 1234: The number of arguments mismatch
-; CHECK: remark: <unknown>:0:0: Cannot promote indirect call: target not found
+; CHECK: remark: <unknown>:0:0: Cannot promote indirect call: target with {{.*}} not found
 ; CHECK: remark: <unknown>:0:0: Cannot promote indirect call to func2 with count of 7890: Return type mismatch
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
Index: lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
===================================================================
--- lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
+++ lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
@@ -269,7 +269,8 @@
       LLVM_DEBUG(dbgs() << " Not promote: Cannot find the target\n");
       ORE.emit([&]() {
         return OptimizationRemarkMissed(DEBUG_TYPE, "UnableToFindTarget", Inst)
-               << "Cannot promote indirect call: target not found";
+               << "Cannot promote indirect call: target with md5sum "
+               << ore::NV("target md5sum", Target) << " not found";
       });
       break;
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51193.162285.patch
Type: text/x-patch
Size: 1504 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180823/3f4f8a32/attachment.bin>


More information about the llvm-commits mailing list