-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Polly Support #75615
Add Polly Support #75615
Conversation
…uses an LLVM which includes polly. Force LLVM rebuild on buildbots.
Topic-branch changes to src/librustc_codegen_llvm/back/write.rs and src/rustllvm/PassWrapper.cpp were ignored as the needed Refactorings would require a detailed understanding of rustc's LLVM backend. Further errors are expected.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @davidtwco (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
r? @nagisa |
@@ -178,6 +177,11 @@ impl Step for Llvm { | |||
.define("LLVM_TARGET_ARCH", target_native.split('-').next().unwrap()) | |||
.define("LLVM_DEFAULT_TARGET_TRIPLE", target_native); | |||
|
|||
if !self.emscripten { | |||
let polly_src = builder.src.join("src/polly"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Polly is included in LLVM checkout, why don't just use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a minimal merge of the old patch into the current master. I already got rid of the Polly submodule, but I tried to not change the code to keep some separation between the updated base and the actual semantic changes that are needed to make this work.
It will use the LLVM submodule's Polly.
let cstr = path2cstr(&path); | ||
let llmod = module.module_llvm.llmod(); | ||
llvm::LLVMWriteBitcodeToFile(llmod, cstr.as_ptr()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all seems to be a merge conflict resolve gone wrong.
Please use rebase instead of merge. https://rustc-dev-guide.rust-lang.org/contributing.html
|
The only reason this PR exists is to allow collaboration on properly hooking the Polly passes into the restructured LLVM pass manager system. I repeat: I know this doesn't compile, and I know I didn't "properly" resolve the merge conflicts. |
☔ The latest upstream changes (presumably #75713) made this pull request unmergeable. Please resolve the merge conflicts. |
I periodically rebase my original work on top of origin/master here: https://github.com/geobacter-rs/rust/tree/polly. |
@namibj thanks for taking the time to contribute. I have to close this due to inactivity. If you wish and you have the time you can open a new PR with these changes and we'll take it from there. Thanks |
Enable LLVM Polly via llvm-args. I think doing it this way is better than in rust-lang#51061. Polly has other useful options and we probably don't want to create a `-Z` flag for each one of them. ![results](https://user-images.githubusercontent.com/7283601/97695555-338f7180-1adf-11eb-82bd-5130e0e6fa89.png) [Benchmark](https://gist.github.com/JRF63/9a6268b91720958e90dbe7abffe20298) I noticed that `-lto` seems to interfere with polly in this specific microbenchmark, as enabling it causes the perf to drop to that of non-polly builds. Other related PRs: rust-lang#75615
As the previous PR #51061 stalled due to upstream changes (I assume Polly getting merged into llvm's repository), I made the effort to resolve most of the conflicts that accumulated between the @DiamondLovesYou 's patch and the current master a few hours ago.
I deliberately left the changes originally made to
src/librustc_codegen_llvm/back/write.rs
andsrc/rustllvm/PassWrapper.cpp
out of my commit, as there has been some heavy refactoring to the hooks used by the old patch, and there weren't enough comments for me to know what I'm doing.I hope someone with a better understanding of rustc's llvm backend could take a look at re-adding the changes to the above-mentioned files that were done by d51fa91 (and reverted in ef47e71).