[llvm] [ctx_prof] CtxProfAnalysis: populate module data (PR #102930)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 12 14:35:12 PDT 2024


================
@@ -81,7 +83,55 @@ CtxProfAnalysis::Result CtxProfAnalysis::run(Module &M,
                              toString(MaybeCtx.takeError()));
     return {};
   }
-  return Result(std::move(*MaybeCtx));
+
+  PGOContextualProfile Result;
+
+  for (const auto &F : M) {
+    if (F.isDeclaration())
+      continue;
+    auto GUID = AssignUniqueIDPass::getGUID(F);
+    assert(GUID);
----------------
snehasish wrote:

Maybe `assert(GUID && "Guid not found ....");` otherwise this just looks like `assert(0)` in the failure message.

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


More information about the llvm-commits mailing list