[PATCH] D110271: [llvm-profgen] Fix an out-of-range error during unwinding

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 22 17:17:23 PDT 2021


wlei added inline comments.


================
Comment at: llvm/tools/llvm-profgen/PerfReader.cpp:81
+      if (!SameInlinee) {
+        State.switchToFrame(End);
         State.CurrentLeafFrame->recordRangeCount(PrevIP, End, Repeat);
----------------
wenlei wrote:
> This is a change beyond refactoring? Before, we use last address of old frame as frame address, but now it's going to be the first address of old frame. 
> 
> `State.switchToFrame(LeafAddr);`
> ->
> `State.switchToFrame(End);`
> 
> Or do did you actually meant `State.switchToFrame(PrevIP);`?
> 
> 
It won't affect the result. I think any address in [PrevIP, End] is good for the leaf frame because we will trim the location info of the last frame. Using `End` is because `End` is also used out of the loop(just for readability).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110271/new/

https://reviews.llvm.org/D110271



More information about the llvm-commits mailing list