[llvm] [profcheck] Add indirect call metadata (PR #154657)
Mingming Liu via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 20 21:04:24 PDT 2025
================
@@ -0,0 +1,31 @@
+; Check insertion and verification of indirect calls
+; RUN: split-file %s %t
+; RUN: opt -passes=prof-inject %t/inject.ll -S -o - | FileCheck %t/inject.ll
+; RUN: opt -passes=prof-verify %t/verify-ok.ll -S -o - | FileCheck %t/verify-ok.ll
+; RUN: not opt -passes=prof-verify %t/verify-bad.ll -S -o - 2>&1 | FileCheck %t/verify-bad.ll
+
+;--- inject.ll
+define void @foo(ptr %f) {
+ call void %f()
+ ret void
+}
+
+; CHECK: call void %f(), !prof
----------------
mingmingl-llvm wrote:
nit: if I understand `ProfileVerify.cpp` correctly, injector will inject the bogus but valid numbers for `%f`. It'd be great if we can tighten the tests and check its value besides `!prof`.
https://github.com/llvm/llvm-project/pull/154657
More information about the llvm-commits
mailing list