-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #114439 - Kobzol:remark-pgo-hotness, r=tmiasko
Add hotness data to LLVM remarks Slight improvement of #113040. This makes sure that if PGO is used, remarks generated using `-Zremark-dir` will include the `Hotness` attribute. r? `@tmiasko`
- Loading branch information
Showing
5 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# needs-profiler-support | ||
# ignore-windows-gnu | ||
|
||
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works | ||
# properly. Since we only have GCC on the CI ignore the test for now. | ||
|
||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#[inline(never)] | ||
pub fn bar() {} | ||
|
||
fn main() { | ||
bar(); | ||
} |