[llvm] [BOLT][test] Fix NFC mismatches in perf2bolt tests (PR #146148)

Amir Ayupov via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 27 12:44:24 PDT 2025


https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/146148

zero-density.s causes spurious NFC mismatches, e.g.
https://lab.llvm.org/buildbot/#/builders/92/builds/21380

This is caused by NFC script wrapping llvm-bolt binary only, so that
perf2bolt invocations are replaced by `llvm-bolt --agregate-only` to
achieve perf2bolt behavior. Add `show-density` to the list of flags
wrapping perf2bolt calls to avoid similar issues in the future.

Test Plan:
```
$ bolt/utils/nfc-check-setup.py --switch-back
$ bin/llvm-lit -a tools/bolt/test/X86/zero-density.s
```


>From 83c593a6aef989fd27ad2a5dec7a2c912123428a Mon Sep 17 00:00:00 2001
From: Amir Ayupov <aaupov at fb.com>
Date: Fri, 27 Jun 2025 12:34:52 -0700
Subject: [PATCH] [BOLT][test] Fix NFC mismatches in perf2bolt tests

zero-density.s causes spurious NFC mismatches, e.g.
https://lab.llvm.org/buildbot/#/builders/92/builds/21380

This is caused by NFC script wrapping llvm-bolt binary only, so that
perf2bolt invocations are replaced by `llvm-bolt --agregate-only` to
achieve perf2bolt behavior. Add `show-density` to the list of flags
wrapping perf2bolt calls to avoid similar issues in the future.

Test Plan:
```
$ bolt/utils/nfc-check-setup.py --switch-back
$ bin/llvm-lit -a tools/bolt/test/X86/zero-density.s
```
---
 bolt/utils/llvm-bolt-wrapper.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bolt/utils/llvm-bolt-wrapper.py b/bolt/utils/llvm-bolt-wrapper.py
index b9d6fad825e78..b913394bce659 100755
--- a/bolt/utils/llvm-bolt-wrapper.py
+++ b/bolt/utils/llvm-bolt-wrapper.py
@@ -79,7 +79,7 @@ def get_cfg(key):
 
 
 # perf2bolt mode
-PERF2BOLT_MODE = ["-aggregate-only", "-ignore-build-id"]
+PERF2BOLT_MODE = ["-aggregate-only", "-ignore-build-id", "-show-density"]
 
 # boltdiff mode
 BOLTDIFF_MODE = ["-diff-only", "-o", "/dev/null"]



More information about the llvm-commits mailing list