[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:01:52 PST 2015


xur marked 10 inline comments as done.

================
Comment at: lib/ProfileData/InstrProfReader.cpp:117
@@ +116,3 @@
+  bool IsIRInstr = false;
+  while (!Line.is_at_end() &&
+         (Line->empty() || Line->startswith("#") || Line->startswith(":"))) {
----------------
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.

================
Comment at: lib/ProfileData/InstrProfReader.cpp:119
@@ +118,3 @@
+         (Line->empty() || Line->startswith("#") || Line->startswith(":"))) {
+    if (Line->startswith(":")) {
+      StringRef Str = (Line)->substr(1);
----------------
davidxl wrote:
> if (!Line->startsWith(":")) {
>    isIRLevelProfile = false;
>    return success();
> }
> 
> 
same as above. current code allows multiple ":" lines. 


http://reviews.llvm.org/D15540





More information about the llvm-commits mailing list