[PATCH] D122844: [llvm-profgen] Fixing a context attribure update issue due to a non-derministic processing order on different platforms.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 13:44:47 PDT 2022


hoy added inline comments.


================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:729
+    if (WasLeafInlined)
+      FProfile.getContext().setAttribute(ContextWasInlined);
   }
----------------
wenlei wrote:
> This fix assumes that the 1st is always going to be called for given context, and it's just a matter of order. Is that actually true?
> 
> What is the exact call path for both cases?  
Yes. Since we go through the lbr samples in an unorderd way (see CSProfileGenerator::populateBodySamplesWithProbes, `ProbeCounter` is an unordered_map), #1 and #2 can be called in arbitrary order on different platforms. If #1 is called before #2, the context will have the correct attribute set even without this fix. On the contrary, we need the fix for #1 to update already existing context.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122844



More information about the llvm-commits mailing list