[PATCH] D15540: [PGO] differentiate FE instrumentation and IR level instrumentation profiles

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 12:25:45 PST 2015


On Fri, Dec 18, 2015 at 12:07 PM, David Li <davidxl at google.com> wrote:
> davidxl added inline comments.
>
> ================
> Comment at: lib/ProfileData/InstrProfReader.cpp:117
> @@ +116,3 @@
> +  bool IsIRInstr = false;
> +  while (!Line.is_at_end() &&
> +         (Line->empty() || Line->startswith("#") || Line->startswith(":"))) {
> ----------------
> xur wrote:
>> davidxl wrote:
>> > Why not skipping comments and empty lines first:
>> >
>> >  // Skip empty lines and comments.
>> >   while (!Line.is_at_end() && (Line->empty() || Line->startswith("#")))
>> >     ++Line;
>> >
>> >
>> current code allows multiple instances of ":" line and the mixing of comments in between (late ones overrides the earlier ones).
>> if you think we should only allow one. We can simplify the code like you suggested.
> We don't want that kind of flexibility for the header structure. I would even suggest making it more strict -- the header lines (if there are any) must start at the first line of the file -- but I won't insist on that.
>
OK. I will change to this way.
I will allow the empty and comment line before ":" line.
It's difficult to enforce it anyway: The construct of LINE object will
skip empty and comment line. So when we read header here, it should be
":" line.


>
> http://reviews.llvm.org/D15540
>
>
>


More information about the llvm-commits mailing list