-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.O-windows-gnuToolchain: GNU, Operating system: WindowsToolchain: GNU, Operating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I am trying to see if -Z pgo-gen is available on Windows-Gnu:
I am using:
rustc 1.26.0-nightly (188e693b3 2018-03-26)
binary: rustc
commit-hash: 188e693b392116c46f746e86f8521f9621fcfd43
commit-date: 2018-03-26
host: x86_64-pc-windows-gnu
release: 1.26.0-nightly
LLVM version: 6.0
I am using a very small Rust test program:
fn main() {
println!("Hello");
}
If I compile with:
rustc -Z pgo-gen test.rs
It gives me:
error: debugging option `pgo-gen` requires a string (Z pgo-gen=<value>)
If I compile with (using a random string?):
rustc -Z pgo-gen=abc test.rs
It gives me:
error[E0463]: can't find crate for `profiler_builtins`
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.O-windows-gnuToolchain: GNU, Operating system: WindowsToolchain: GNU, Operating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
matthiaskrgr commentedon Mar 27, 2018
Hi, I was also struggling with that! :)
The
=val
is supposed to be the profile file which details are written into after executing the pgo-gen instrumented binary and details are read from when building the binary for the second time with pgo-use.So
RUSTFLAGS="-Z pgo-gen=profile_data.pgo" cargo build --release
*do things with the program*
RUSTFLAGS="-Z pgo-use=profile_data.pgo" cargo build --release
might work :)
leonardo-m commentedon Mar 27, 2018
I've tried to do as you say, but perhaps I am doing something wrong. I've created a binary project with cargo (just the hello world), then I've set the variable:
set RUSTFLAGS="-Z pgo-gen=profile_data.pgo"
Then I've compiled:
cargo build --release
It gives me:
matthiaskrgr commentedon Mar 27, 2018
Hm, I'm not sure what is going on there now (I also can't reproduce since not a windows user), sorry :/
leonardo-m commentedon Apr 12, 2019
Using:
Calling rustc directly gives:
mati865 commentedon Apr 12, 2019
GNU toolchain is built without profiler: https://github.com/rust-lang/rust/blob/9a612b2348212d84fa0b839a4c18e4a13fafaf05/appveyor.yml
michaelwoerister commentedon May 14, 2019
I wonder if we could just enable the profiler on
*-pc-windows-gnu
.mati865 commentedon May 14, 2019
I think I can find time this week to test it.
I'm almost sure PGO was broken on some older GCC version but I cannot recall the details.
mati865 commentedon May 19, 2019
Status update:
I've got it working few days ago but pushing this upstream is blocked on upgrading
compiler-builtins
to 0.1.15. It was meant to be done by #60841 but was backed off.Rollup merge of rust-lang#61080 - mati865:mingw_pgo, r=sanxiyn
Rollup merge of rust-lang#61080 - mati865:mingw_pgo, r=sanxiyn
Rollup merge of rust-lang#61080 - mati865:mingw_pgo, r=sanxiyn
Rollup merge of rust-lang#61080 - mati865:mingw_pgo, r=sanxiyn
Rollup merge of rust-lang#61080 - mati865:mingw_pgo, r=sanxiyn
Auto merge of #61080 - mati865:mingw_pgo, r=sanxiyn