Skip to content

Commit 0ded7a7

Browse files
committed
CI-unixish.yml: added profile-guided optimization (PGO) to callgrind step
1 parent 6ddb8c6 commit 0ded7a7

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/CI-unixish.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,34 @@ jobs:
145145
run: |
146146
wget https://github.com/danmar/simplecpp/archive/refs/tags/1.5.1.tar.gz
147147
tar xvf 1.5.1.tar.gz
148+
rm -f 1.5.1.tar.gz
149+
148150
make clean
149-
make -j$(nproc) CXXOPTS="-O2 -g3"
151+
make -j$(nproc) CXXOPTS="-O2 -g3" simplecpp
150152
VALGRIND_TOOL=callgrind SIMPLECPP_PATH=simplecpp-1.5.1 ./selfcheck.sh >callgrind.log || (cat callgrind.log && false)
151153
cat callgrind.log
154+
155+
# PGO - start
156+
make clean
157+
make -j$(nproc) CXXOPTS="-O2 -g3 -fprofile-generate" LDOPTS="-fprofile-generate" simplecpp
158+
SIMPLECPP_PATH=simplecpp-1.5.1 ./selfcheck.sh >/dev/null
159+
160+
if compgen -G "default_*.profraw" > /dev/null; then
161+
llvm-profdata merge -output=default.profdata default_*.profraw
162+
fi
163+
164+
make clean
165+
make -j$(nproc) CXXOPTS="-O2 -g3 -fprofile-use" LDOPTS="-fprofile-use" simplecpp
166+
VALGRIND_TOOL=callgrind SIMPLECPP_PATH=simplecpp-1.5.1 ./selfcheck.sh >callgrind_pgo.log || (cat callgrind_pgo.log && false)
167+
cat callgrind_pgo.log
168+
# PGO - end
169+
152170
for f in callgrind.out.*;
153171
do
154172
callgrind_annotate --auto=no $f > $f.annotated.log
155173
head -50 $f.annotated.log
156174
done
175+
rm -rf simplecpp-1.5.1
157176
158177
- uses: actions/upload-artifact@v4
159178
if: matrix.os == 'ubuntu-24.04'

0 commit comments

Comments
 (0)