[llvm-branch-commits] [llvm] [NFC][MemProf] Replace memprofraw with YAML in memprof.ll test (PR #216878)

Ellis Hoag via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Aug 17 16:49:09 PDT 2026


================
@@ -1,35 +1,16 @@
 ;; Tests memprof profile matching (with and without instrumentation profiles).
+; RUN: rm -rf %t && split-file %s %t
 
-;; Several requirements due to using raw profile inputs:
-;; PGO profile uses zlib compression
-; REQUIRES: zlib
-;; Avoid failures on big-endian systems that can't read the profile properly
-; REQUIRES: x86_64-linux
 ;; -stats requires asserts
 ; REQUIRES: asserts
 
-;; TODO: Use text profile inputs once that is available for memprof.
-;; # To update the Inputs below, run Inputs/update_memprof_inputs.sh.
-;; # To generate below LLVM IR for use in matching:
-;; $ clang++ -gmlt -fdebug-info-for-profiling -fno-omit-frame-pointer \
-;;	-fno-optimize-sibling-calls memprof.cc -S -emit-llvm
-
 ;; Generate indexed profiles of all combinations:
-; RUN: llvm-profdata merge %S/Inputs/memprof.memprofraw --profiled-binary %S/Inputs/memprof.exe -o %t.memprofdata
-; RUN: llvm-profdata merge %S/Inputs/memprof_pgo.proftext %S/Inputs/memprof.memprofraw --profiled-binary %S/Inputs/memprof.exe -o %t.pgomemprofdata
-; RUN: llvm-profdata merge %S/Inputs/memprof_pgo.proftext -o %t.pgoprofdata
-; RUN: llvm-profdata merge %S/Inputs/memprof.nocolinfo.memprofraw --profiled-binary %S/Inputs/memprof.nocolinfo.exe -o %t.nocolinfo.memprofdata
-
-;; Check that the summary can be shown (and is identical) for both the raw and indexed profiles.
-; RUN: llvm-profdata show --memory %S/Inputs/memprof.memprofraw --profiled-binary %S/Inputs/memprof.exe | FileCheck %s --check-prefixes=SUMMARY
-; RUN: llvm-profdata show --memory %t.memprofdata | FileCheck %s --check-prefixes=SUMMARY
-; SUMMARY: # MemProfSummary:
-; SUMMARY: #   Total contexts: 8
-; SUMMARY: #   Total cold contexts: 5
-; SUMMARY: #   Total hot contexts: 0
-; SUMMARY: #   Maximum cold context total size: 10
-; SUMMARY: #   Maximum warm context total size: 10
-; SUMMARY: #   Maximum hot context total size: 0
+; RUN: llvm-profdata merge %t/a.yaml -o %t/a.memprofdata
+; RUN: llvm-profdata merge %t/a.proftext %t/a.yaml -o %t/a.pgomemprofdata
+; RUN: llvm-profdata merge %t/a.proftext -o %t/a.pgoprofdata
+;; Simulate a profile from a -gno-column-info build by zeroing all columns.
+; RUN: sed -E 's/Column: [0-9]+,/Column: 0,/g' %t/a.yaml > %t/a.nocolinfo.yaml
----------------
ellishg wrote:

I also opted to manually zero out the columns rather than adding a second `.yaml` file.

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


More information about the llvm-branch-commits mailing list