[llvm] [NFC][PGOProfile] Inline icall annotation proftext test (PR #226324)

Ellis Hoag via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 16:00:50 PDT 2026


https://github.com/ellishg created https://github.com/llvm/llvm-project/pull/226324

Use `split-file` to inline `indirect_call.proftext` directly into the test to make it easier to reason about the test.

>From 9226bec7e09eb54718a4e8892b21643dc34d1b0b Mon Sep 17 00:00:00 2001
From: Ellis Hoag <ellishoag at meta.com>
Date: Thu, 24 Sep 2026 15:49:10 -0700
Subject: [PATCH] [NFC][PGOProfile] Inline icall annotation proftext

---
 .../PGOProfile/Inputs/indirect_call.proftext  | 43 ----------------
 .../PGOProfile/indirect_call_annotation.ll    | 49 ++++++++++++++++++-
 2 files changed, 47 insertions(+), 45 deletions(-)
 delete mode 100644 llvm/test/Transforms/PGOProfile/Inputs/indirect_call.proftext

diff --git a/llvm/test/Transforms/PGOProfile/Inputs/indirect_call.proftext b/llvm/test/Transforms/PGOProfile/Inputs/indirect_call.proftext
deleted file mode 100644
index bb48ccc57a8bff..00000000000000
--- a/llvm/test/Transforms/PGOProfile/Inputs/indirect_call.proftext
+++ /dev/null
@@ -1,43 +0,0 @@
-:ir
-bar
-# Func Hash:
-170957022131388415
-# Num Counters:
-1
-# Counter Values:
-140
-# Num Value Kinds:
-1
-# ValueKind = IPVK_IndirectCallTarget:
-0
-# NumValueSites:
-1
-3
-func2:80
-func1:40
-func3:20
-
-func1
-# Func Hash:
-742261418966908927
-# Num Counters:
-1
-# Counter Values:
-40
-
-func2
-# Func Hash:
-742261418966908927
-# Num Counters:
-1
-# Counter Values:
-80
-
-func3
-# Func Hash:
-742261418966908927
-# Num Counters:
-1
-# Counter Values:
-20
-
diff --git a/llvm/test/Transforms/PGOProfile/indirect_call_annotation.ll b/llvm/test/Transforms/PGOProfile/indirect_call_annotation.ll
index 6f8b26fa6ae20e..ddd2c851ecdffa 100644
--- a/llvm/test/Transforms/PGOProfile/indirect_call_annotation.ll
+++ b/llvm/test/Transforms/PGOProfile/indirect_call_annotation.ll
@@ -1,5 +1,8 @@
-; RUN: llvm-profdata merge %S/Inputs/indirect_call.proftext -o %t.profdata
-; RUN: opt < %s -passes=pgo-instr-use -pgo-test-profile-file=%t.profdata -S | FileCheck %s --check-prefix=VP-ANNOTATION
+; RUN: split-file %s %t
+; RUN: llvm-profdata merge %t/a.proftext -o %t/a.profdata
+; RUN: opt < %t/a.ll -passes=pgo-instr-use -pgo-test-profile-file=%t/a.profdata -S | FileCheck %s --check-prefix=VP-ANNOTATION
+
+;--- a.ll
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
@@ -32,4 +35,46 @@ entry:
   ret i32 %call
 }
 
+;--- a.proftext
+:ir
+bar
+# Func Hash:
+170957022131388415
+# Num Counters:
+1
+# Counter Values:
+140
+# Num Value Kinds:
+1
+# ValueKind = IPVK_IndirectCallTarget:
+0
+# NumValueSites:
+1
+3
+func2:80
+func1:40
+func3:20
+
+func1
+# Func Hash:
+742261418966908927
+# Num Counters:
+1
+# Counter Values:
+40
+
+func2
+# Func Hash:
+742261418966908927
+# Num Counters:
+1
+# Counter Values:
+80
 
+func3
+# Func Hash:
+742261418966908927
+# Num Counters:
+1
+# Counter Values:
+20



More information about the llvm-commits mailing list