Skip to content

Commit ee043ec

Browse files
committed
rewrite optimization-remarks-dir-pgo to rmake
1 parent 537a07a commit ee043ec

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ run-make/no-alloc-shim/Makefile
131131
run-make/no-builtins-attribute/Makefile
132132
run-make/no-duplicate-libs/Makefile
133133
run-make/obey-crate-type-flag/Makefile
134-
run-make/optimization-remarks-dir-pgo/Makefile
135134
run-make/optimization-remarks-dir/Makefile
136135
run-make/output-type-permutations/Makefile
137136
run-make/override-aliased-flags/Makefile

tests/run-make/optimization-remarks-dir-pgo/Makefile

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// This test checks the -Zremark-dir flag, which writes LLVM
2+
// optimization remarks to the YAML format. When using PGO (Profile
3+
// Guided Optimization), the Hotness attribute should be included in
4+
// the output remark files.
5+
// See https://github.com/rust-lang/rust/pull/114439
6+
7+
//@ needs-profiler-support
8+
//@ ignore-cross-compile
9+
10+
use run_make_support::{run, llvm_profdata, rustc, invalid_utf8_contains};
11+
12+
fn main() {
13+
rustc().profile_generate("profdata").opt().input("foo.rs").output("foo").run();
14+
run("foo");
15+
llvm_profdata().merge().output("merged.profdata").input("profdata/default_15907418011457399462_0.profraw").run();
16+
rustc().profile_use("merged.profdata").opt().input("foo.rs").arg("-Cremark=all").arg("-Zremark-dir=profiles").run();
17+
// Check that PGO hotness is included in the remark files
18+
invalid_utf8_contains("profiles/foo.cba44757bc0621b9-cgu.0.opt.opt.yaml", "Hotness");
19+
}

0 commit comments

Comments
 (0)