[PATCH] D98835: [SampleFDO] Don't mix up the existing indirect call value profile with the new value profile annotated after inlining.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 17 20:19:55 PDT 2021


davidxl added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:772
   if (Valid) {
-    for (uint32_t I = 0; I < NumVals; I++)
+    for (uint32_t I = 0; I < NumVals; I++) {
+      // If the given Sum is not 0, the existing values with count
----------------
The logic seems clearer if the handling is specialized for sum == 0 and != 0 case:

if (sum == 0) {
} else {
   // iniitlaize value count map with already promoted targets.
    ....

}


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98835



More information about the llvm-commits mailing list