[llvm] [profcheck] Add indirect call metadata (PR #154657)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 20 21:19:48 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
----------------
mtrofin wrote:

We want to do value verification in general later (see the RFC linked from the issue linked). The RFC mostly talks about branch weights though; I think for VP it'll be even more tricky: we'd need to be able to tell if the VP came from us or came from the original test; also - say this were to test IPC. The metadata for the leftover indirect call (what's not promoted) should be "shortened" with the promoted targets removed.

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


More information about the llvm-commits mailing list