File tree 3 files changed +25
-0
lines changed
compiler/rustc_llvm/llvm-wrapper
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(
1967
1967
std::unique_ptr<LLVMRemarkStreamer> LlvmRemarkStreamer;
1968
1968
1969
1969
if (RemarkFilePath != nullptr ) {
1970
+ // Enable PGO hotness data for remarks, if available
1971
+ unwrap (C)->setDiagnosticsHotnessRequested (true );
1972
+
1970
1973
std::error_code EC;
1971
1974
RemarkFile = std::make_unique<ToolOutputFile>(
1972
1975
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