rust/tests/run-make/optimization-remarks-dir-pgo/Makefile
Jakub Beránek 93bdc01adf
Add hotness data to LLVM remarks
This makes sure that if PGO is used, remarks generated using `-Zremark-dir` will include the `Hotness` attribute.
2023-08-04 10:31:00 +02:00

17 lines
509 B
Makefile

# needs-profiler-support
include ../tools.mk
PROFILE_DIR=$(TMPDIR)/profiles
check_hotness:
$(RUSTC) -Cprofile-generate="$(TMPDIR)"/profdata -O foo.rs -o$(TMPDIR)/foo
$(TMPDIR)/foo
"$(LLVM_BIN_DIR)"/llvm-profdata merge \
-o "$(TMPDIR)"/merged.profdata \
"$(TMPDIR)"/profdata/*.profraw
$(RUSTC) -Cprofile-use=$(TMPDIR)/merged.profdata -O foo.rs -Cremark=all -Zremark-dir=$(PROFILE_DIR)
# Check that PGO hotness is included in the remark files
cat $(PROFILE_DIR)/*.opt.yaml | $(CGREP) -e "Hotness"