[PATCH] Refactor classes in sample profiler for new functionality
Diego Novillo
dnovillo at google.com
Tue Nov 26 12:29:10 PST 2013
On Tue, Nov 26, 2013 at 2:51 PM, Chandler Carruth <chandlerc at gmail.com>wrote:
>
> Patch looks fine to commit. I have a question below about code I don't
> understand, but it's not new in this patch I just didn't notice it before.
>
> I do wonder, would s/Global/Module/g be more clear in an LLVM context?
>
Good point. Changed.
>
>
> ================
> Comment at: lib/Transforms/Scalar/SampleProfile.cpp:332-333
> @@ -310,9 +331,4 @@
> Loader.reportParseError("Expected a number, found " + Line);
> - for (int I = 0; I < NumSymbols; I++) {
> - StringRef FName = Loader.readLine();
> - FunctionProfile &FProfile = Profiles[FName];
> - FProfile.BodySamples.clear();
> - FProfile.TotalSamples = 0;
> - FProfile.TotalHeadSamples = 0;
> - }
> + for (int I = 0; I < NumSymbols; I++)
> + Profiles[Loader.readLine()] = SampleFunctionProfile();
>
Well, it is and it isn't. It's true that we build empty ones later on, but
this one is having the side-effect of reading the symbol table. I'll get
rid of it when I change the output from the profiler.
Diego.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131126/01ec5a97/attachment.html>
More information about the llvm-commits
mailing list