[llvm] [GitHub] Post ./utils/compare.py results in /test-suite (PR #208154)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 8 00:06:01 PDT 2026
https://github.com/lukel97 created https://github.com/llvm/llvm-project/pull/208154
llvm-test-suite comes with a ./utils/compare.py script which can compare metrics across different builds. This PR adds support for displaying these results in the GitHub comment as markdown table.
For now it just shows the difference in code size (the size..text metric), but in future it can be extended to show the reuslts of any arbitrary LLVM statistic.
It also posts the link to the result json files themselves in case the user wants to do some more analysis locally.
>From 671c63b2b730702857440990a056383f65cae254 Mon Sep 17 00:00:00 2001
From: Luke Lau <luke at igalia.com>
Date: Tue, 7 Jul 2026 15:00:56 +0800
Subject: [PATCH] [GitHub] Post ./utils/compare.py results in /test-suite
---
.github/workflows/test-suite.yml | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml
index 6814a40e1d045..387b20b7af548 100644
--- a/.github/workflows/test-suite.yml
+++ b/.github/workflows/test-suite.yml
@@ -114,7 +114,7 @@ jobs:
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ noble main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
sudo apt-get update
- sudo apt-get install -y cmake tcl libc6-dev-arm64-cross libc6-dev-riscv64-cross libgcc-14-dev-arm64-cross libgcc-14-dev-riscv64-cross libstdc++-14-dev-arm64-cross libstdc++-14-dev-riscv64-cross
+ sudo apt-get install -y cmake tcl libc6-dev-arm64-cross libc6-dev-riscv64-cross libgcc-14-dev-arm64-cross libgcc-14-dev-riscv64-cross libstdc++-14-dev-arm64-cross libstdc++-14-dev-riscv64-cross python3-pandas python3-tabulate
- name: Configure Clang
run: cmake -B build -C $SCRIPTS_DIR/llvm.cmake llvm -GNinja
working-directory: llvm-project
@@ -150,17 +150,37 @@ jobs:
name: diffs
path: llvm-test-suite/diffs
- name: Upload results
+ id: upload-results
uses: actions/upload-artifact at bbbca2ddaa5d8feaa63e36b76fdaad77386f024f #v7.0.0
with:
name: results
path: llvm-test-suite/results*.json
+ - name: Compare results
+ run: |
+ for ARCH in rva23u64-O3 armv9-a-O3 x86_64-O3
+ do
+ ./utils/compare.py results.$ARCH-base.json vs results.$ARCH-head.json -m size..text --only-changed --lhs-name base --rhs-name head --format=md > ../compare-$ARCH.md || true
+ done
+ working-directory: llvm-test-suite
- name: Create comment
env:
ARTIFACT_URL: ${{ steps.upload-diffs.outputs.artifact-url }}
+ RESULTS_URL: ${{ steps.upload-results.outputs.artifact-url }}
run: |
- cat << EOF > comments
- [{"body" : "test-suite diff from $BASE_SHA...$HEAD_SHA: $ARTIFACT_URL"}]
+ cat << EOF > comment-body
+ test-suite diff from $BASE_SHA...$HEAD_SHA: $ARTIFACT_URL
+
+ Statistics: $RESULTS_URL
+
+ ## riscv64-linux-gnu `-march=rva23u64 -O3`
+ $(cat compare-rva23u64-O3.md)
+ ## aarch64-linux-gnu `-march=armv9-a -O3`
+ $(cat compare-armv9-a-O3.md)
+ ## x86_64-linux-gnu `-O3`
+ $(cat compare-x86_64-O3.md)
EOF
+ # write escaped markdown to format expected by issue-write.yml
+ python3 -c 'import json; print(json.dumps([{"body": open("comment-body").read()}]))' > comments
- name: Create comment on failure
if: failure()
env:
More information about the llvm-commits
mailing list