This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
compiler/rustc_llvm/llvm-wrapper Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -1967,6 +1967,9 @@ extern "C" void LLVMRustContextConfigureDiagnosticHandler(
19671967 std::unique_ptr<LLVMRemarkStreamer> LlvmRemarkStreamer;
19681968
19691969 if (RemarkFilePath != nullptr ) {
1970+ // Enable PGO hotness data for remarks, if available
1971+ unwrap (C)->setDiagnosticsHotnessRequested (true );
1972+
19701973 std::error_code EC;
19711974 RemarkFile = std::make_unique<ToolOutputFile>(
19721975 RemarkFilePath,
Original file line number Diff line number Diff line change 1+ # needs-profiler-support
2+
3+ include ../tools.mk
4+
5+ PROFILE_DIR =$(TMPDIR ) /profiles
6+
7+ check_hotness :
8+ $(RUSTC ) -Cprofile-generate=" $( TMPDIR) " /profdata -O foo.rs -o$(TMPDIR ) /foo
9+ $(TMPDIR ) /foo
10+ " $( LLVM_BIN_DIR) " /llvm-profdata merge \
11+ -o " $( TMPDIR) " /merged.profdata \
12+ " $( TMPDIR) " /profdata/* .profraw
13+ $(RUSTC ) -Cprofile-use=$(TMPDIR ) /merged.profdata -O foo.rs -Cremark=all -Zremark-dir=$(PROFILE_DIR )
14+
15+ # Check that PGO hotness is included in the remark files
16+ cat $(PROFILE_DIR)/*.opt.yaml | $(CGREP) -e "Hotness"
Original file line number Diff line number Diff line change 1+ #[ inline( never) ]
2+ pub fn bar ( ) { }
3+
4+ fn main ( ) {
5+ bar ( ) ;
6+ }
You can’t perform that action at this time.
0 commit comments