[llvm] [ctx_prof] Add Inlining support (PR #106154)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 30 13:42:57 PDT 2024


================
@@ -0,0 +1,101 @@
+; RUN: rm -rf %t
+; RUN: split-file %s %t
+; RUN: llvm-ctxprof-util fromJSON --input=%t/profile.json --output=%t/profile.ctxprofdata
+
+; RUN: opt -passes='module-inline,print<ctx-prof-analysis>' %t/module.ll -S \
+; RUN:   -use-ctx-profile=%t/profile.ctxprofdata -ctx-profile-printer-level=json \
+; RUN:   -o - 2> %t/profile-final.txt | FileCheck %s
+; RUN: %python %S/json_equals.py %t/profile-final.txt %t/expected.json
+
+; CHECK-LABEL: @entrypoint
+; CHECK-LABEL: yes:
+; CHECK:         call void @llvm.instrprof.increment(ptr @entrypoint, i64 0, i32 3, i32 1)
----------------
mtrofin wrote:

yes. we keep the instrumentation until we flatten the profile and then lower the flattened profile to `MD_prof`. The instrumentation will serve as a means to associate counter values in the contextual profile to BBs.

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


More information about the llvm-commits mailing list