[llvm] r308668 - [PGO] Move the PGOInstrumentation pass to new OptRemark API.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 27 10:58:54 PDT 2018


On Tue, Mar 27, 2018 at 10:56 AM, Xinliang David Li
<xinliangli at gmail.com> wrote:
>
>
> On Tue, Mar 27, 2018 at 10:21 AM, Davide Italiano <davide at freebsd.org>
> wrote:
>>
>> On Fri, Mar 23, 2018 at 10:06 AM, Xinliang David Li
>> <xinliangli at gmail.com> wrote:
>> >
>> >
>> > On Thu, Jul 20, 2017 at 1:43 PM, Davide Italiano via llvm-commits
>> > <llvm-commits at lists.llvm.org> wrote:
>> >>
>> >> Author: davide
>> >> Date: Thu Jul 20 13:43:05 2017
>> >> New Revision: 308668
>> >>
>> >> URL: http://llvm.org/viewvc/llvm-project?rev=308668&view=rev
>> >> Log:
>> >> [PGO] Move the PGOInstrumentation pass to new OptRemark API.
>> >>
>> >> This fixes PR33791.
>> >>
>> >> Modified:
>> >>     llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
>> >>     llvm/trunk/test/Transforms/PGOProfile/branch1.ll
>> >>
>> >> Modified:
>> >> llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
>> >> URL:
>> >>
>> >> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp?rev=308668&r1=308667&r2=308668&view=diff
>> >>
>> >>
>> >> ==============================================================================
>> >> --- llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
>> >> (original)
>> >> +++ llvm/trunk/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
>> >> Thu
>> >> Jul 20 13:43:05 2017
>> >> @@ -59,6 +59,7 @@
>> >>  #include "llvm/Analysis/CFG.h"
>> >>  #include "llvm/Analysis/IndirectCallSiteVisitor.h"
>> >>  #include "llvm/Analysis/LoopInfo.h"
>> >> +#include "llvm/Analysis/OptimizationDiagnosticInfo.h"
>> >>  #include "llvm/IR/CallSite.h"
>> >>  #include "llvm/IR/DiagnosticInfo.h"
>> >>  #include "llvm/IR/Dominators.h"
>> >> @@ -1483,10 +1484,9 @@ void setProfMetadata(Module *M, Instruct
>> >>      OS << " (total count : " << TotalCount << ")";
>> >>      OS.flush();
>> >>      Function *F = TI->getParent()->getParent();
>> >> -    emitOptimizationRemarkAnalysis(
>> >> -        F->getContext(), "pgo-use-annot", *F, TI->getDebugLoc(),
>> >> -        Twine(BrCondStr) +
>> >> -            " is true with probability : " + Twine(BranchProbStr));
>> >> +    OptimizationRemarkEmitter ORE(F);
>> >> +    ORE.emit(OptimizationRemark(DEBUG_TYPE, "pgo-instrumentation", TI)
>> >> +             << BrCondStr << " is true with probability : " <<
>> >> BranchProbStr);
>> >>    }
>> >>  }
>> >>
>> >
>> >
>> > 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?
>> >
>>
>> (sorry for the late answer)
>> This was supposed to be NFC, so, no, this wasn't intended.
>>
>> I assume we
>> didn't have enough coverage to find out this actually broke?
>>
>
> The test case was also modified :).  Also this option is a performance debug
> option (pgo related), so yes, there is no better way to catch the break (not
> really a break, but a change).
>

I would like to apologize, I missed I also modified the test. Anyway,
I can probably revert this or look over the weekend (FWIW, if you have
urgency and want to look at this earlier, be my guest).

Thanks,

--
Davide


More information about the llvm-commits mailing list