[PATCH] D107529: [llvm-profgen] Fix bug of loop scope mismatch

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 4 20:53:36 PDT 2021


wlei created this revision.
Herald added subscribers: hoy, wenlei, lxfind.
wlei requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107529

Files:
  llvm/tools/llvm-profgen/ProfileGenerator.cpp


Index: llvm/tools/llvm-profgen/ProfileGenerator.cpp
===================================================================
--- llvm/tools/llvm-profgen/ProfileGenerator.cpp
+++ llvm/tools/llvm-profgen/ProfileGenerator.cpp
@@ -559,15 +559,14 @@
             FunctionProfile.getContext().getNameWithoutContext(), Count);
       }
     }
-
-    // Assign zero count for remaining probes without sample hits to
-    // differentiate from probes optimized away, of which the counts are unknown
-    // and will be inferred by the compiler.
-    for (auto &I : FrameSamples) {
-      auto *FunctionProfile = I.second;
-      for (auto *Probe : I.first->getProbes()) {
-        FunctionProfile->addBodySamplesForProbe(Probe->getIndex(), 0);
-      }
+  }
+  // Assign zero count for remaining probes without sample hits to
+  // differentiate from probes optimized away, of which the counts are unknown
+  // and will be inferred by the compiler.
+  for (auto &I : FrameSamples) {
+    auto *FunctionProfile = I.second;
+    for (auto *Probe : I.first->getProbes()) {
+      FunctionProfile->addBodySamplesForProbe(Probe->getIndex(), 0);
     }
   }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107529.364336.patch
Type: text/x-patch
Size: 1142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210805/1dd7a383/attachment.bin>


More information about the llvm-commits mailing list