[PATCH] D10674: Value profiling - patchset 3

Betul Buyukkurt via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 10:49:36 PDT 2015


betulb added a comment.

> davidxl added inline comments.

> 

> ================

>  Comment at: lib/ProfileData/InstrProfReader.cpp:326

>  @@ +325,3 @@

>  +      for (uint64_t VCount = 0; VCount < ValueDataCount; ++VCount) {

>  +        if (D + 2 * sizeof(uint64_t) > End)

>  +          return false;

> 

>  ----------------

> 

> This check can be moved outside of the loop.


Done.

> ================

>  Comment at: lib/ProfileData/InstrProfReader.cpp:332

>  @@ +331,3 @@

>  +          auto Result = HashKeyMap.find(Value);

>  +          if (Result == HashKeyMap.end())

>  +            continue;

> 

>  ----------------

> 

> If there is no better way to do error handling here, set the value to Null

>  before continue.


Actually, I should have reported this as an error. So, I've changed the
"continue;" statement to "return false;". This change should cause the
reader to report error: "Malformed profile data".

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



http://reviews.llvm.org/D10674





More information about the llvm-commits mailing list