<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 20, 2017 at 1:43 PM, Davide Italiano via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: davide<br>
Date: Thu Jul 20 13:43:05 2017<br>
New Revision: 308668<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=308668&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=308668&view=rev</a><br>
Log:<br>
[PGO] Move the PGOInstrumentation pass to new OptRemark API.<br>
<br>
This fixes PR33791.<br>
<br>
Modified:<br>
    llvm/trunk/lib/Transforms/<wbr>Instrumentation/<wbr>PGOInstrumentation.cpp<br>
    llvm/trunk/test/Transforms/<wbr>PGOProfile/branch1.ll<br>
<br>
Modified: llvm/trunk/lib/Transforms/<wbr>Instrumentation/<wbr>PGOInstrumentation.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp?rev=308668&r1=308667&r2=308668&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/lib/<wbr>Transforms/Instrumentation/<wbr>PGOInstrumentation.cpp?rev=<wbr>308668&r1=308667&r2=308668&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/Transforms/<wbr>Instrumentation/<wbr>PGOInstrumentation.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/<wbr>Instrumentation/<wbr>PGOInstrumentation.cpp Thu Jul 20 13:43:05 2017<br>
@@ -59,6 +59,7 @@<br>
 #include "llvm/Analysis/CFG.h"<br>
 #include "llvm/Analysis/<wbr>IndirectCallSiteVisitor.h"<br>
 #include "llvm/Analysis/LoopInfo.h"<br>
+#include "llvm/Analysis/<wbr>OptimizationDiagnosticInfo.h"<br>
 #include "llvm/IR/CallSite.h"<br>
 #include "llvm/IR/DiagnosticInfo.h"<br>
 #include "llvm/IR/Dominators.h"<br>
@@ -1483,10 +1484,9 @@ void setProfMetadata(Module *M, Instruct<br>
     OS << " (total count : " << TotalCount << ")";<br>
     OS.flush();<br>
     Function *F = TI->getParent()->getParent();<br>
-    emitOptimizationRemarkAnalysis<wbr>(<br>
-        F->getContext(), "pgo-use-annot", *F, TI->getDebugLoc(),<br>
-        Twine(BrCondStr) +<br>
-            " is true with probability : " + Twine(BranchProbStr));<br>
+    OptimizationRemarkEmitter ORE(F);<br>
+    ORE.emit(OptimizationRemark(<wbr>DEBUG_TYPE, "pgo-instrumentation", TI)<br>
+             << BrCondStr << " is true with probability : " << BranchProbStr);<br>
   }<br>
 }<br>
<br></blockquote><div><br></div><div><br></div><div>Davide, I just noticed this change.  This message is not about transformations nor missed optimizations, so it should remain as 'remark-analysis'. Also the pass name should not be 'pgo-instrumentation' because it is only meaningful during profile annotation pass.  Any reason for the underlying change?</div><div><br></div><div>thanks,</div><div><br></div><div>David</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Modified: llvm/trunk/test/Transforms/<wbr>PGOProfile/branch1.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/branch1.ll?rev=308668&r1=308667&r2=308668&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/test/<wbr>Transforms/PGOProfile/branch1.<wbr>ll?rev=308668&r1=308667&r2=<wbr>308668&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/Transforms/<wbr>PGOProfile/branch1.ll (original)<br>
+++ llvm/trunk/test/Transforms/<wbr>PGOProfile/branch1.ll Thu Jul 20 13:43:05 2017<br>
@@ -15,8 +15,8 @@<br>
 ; RUN: opt < %s -passes=pgo-instr-use -pgo-test-profile-file=%t.<wbr>profdata -S | FileCheck %s --check-prefix=USE<br>
 ; RUN: opt < %s -passes=pgo-instr-use -pgo-test-profile-file=%t.l.<wbr>profdata -S | FileCheck %s --check-prefix=USE-LARGE<br>
<br>
-; RUN: opt < %s -pgo-instr-use -pgo-test-profile-file=%t.<wbr>profdata -pass-remarks-analysis=pgo-<wbr>use-annot -pgo-emit-branch-prob -S 2>&1| FileCheck %s --check-prefix=ANALYSIS<br>
-; RUN: opt < %s -passes=pgo-instr-use -pgo-test-profile-file=%t.<wbr>profdata -pass-remarks-analysis=pgo-<wbr>use-annot -pgo-emit-branch-prob -S 2>&1| FileCheck %s --check-prefix=ANALYSIS<br>
+; RUN: opt < %s -pgo-instr-use -pgo-test-profile-file=%t.<wbr>profdata -pass-remarks=pgo-<wbr>instrumentation -pgo-emit-branch-prob -S 2>&1| FileCheck %s --check-prefix=ANALYSIS<br>
+; RUN: opt < %s -passes=pgo-instr-use -pgo-test-profile-file=%t.<wbr>profdata -pass-remarks=pgo-<wbr>instrumentation -pgo-emit-branch-prob -S 2>&1| FileCheck %s --check-prefix=ANALYSIS<br>
<br>
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:<wbr>32:64-S128"<br>
 target triple = "x86_64-unknown-linux-gnu"<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>