[llvm] [ctx_prof] Profile flatterner (PR #104539)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 22:02:22 PDT 2024


================
@@ -193,3 +201,35 @@ InstrProfCallsite *CtxProfAnalysis::getCallsiteInstrumentation(CallBase &CB) {
       return IPC;
   return nullptr;
 }
+
+static void
+preorderVisit(const PGOCtxProfContext::CallTargetMapTy &Profiles,
+              function_ref<void(const PGOCtxProfContext &)> Visitor) {
+  std::function<void(const PGOCtxProfContext &)> Traverser =
----------------
boomanaiden154 wrote:

Is there a reason for the lambda here? I don't think it adds much clarity over just nesting the for loops.

https://github.com/llvm/llvm-project/pull/104539


More information about the llvm-commits mailing list