-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Fix a few AMDGPU related issues #52514
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
Ping from triage @eddyb! This PR needs your review. |
Ping from triage! This PR needs a review, can @eddyb or someone else from @rust-lang/compiler review this? |
The code itself looks good to me. Leaving to somebody else that has better knowledge of llvm to chime in and r+. |
src/librustc_target/spec/mod.rs
Outdated
/// and basically inline everything regardless of our wishes anyway. | ||
/// This causes LLVM validation errors due to the conflicting attributes. | ||
/// Defaults to false. | ||
pub ignore_inline_never: bool, |
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.
General strategy is to have is_like_platform
for platform-specific handling.
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 seems fine to me, though.
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.
Please don't do this, if it's a LLVM-specific temporary hack, add code for it checking e.g. architecture name in triple, to rustc_codegen_llvm
.
src/librustc_codegen_llvm/builder.rs
Outdated
@@ -564,6 +564,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { | |||
|
|||
|
|||
pub fn range_metadata(&self, load: ValueRef, range: Range<u128>) { | |||
if self.sess().target.target.arch == "amdgpu" { | |||
// amdgpu/LLVM does something weird and thinks a i64 value is |
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 sounds like a bug in LLVM. Consider filling a (rust-lang) issue and referencing this piece of code there.
It is definitely desirable to maintain range metadata somehow.
@bors r+ |
📌 Commit d992a94 has been approved by |
Fix a few AMDGPU related issues * AMDGPU ignores `noinline` and sadly doesn't clear the attribute when it slaps `alwaysinline` on everything, * an AMDGPU related load bit range metadata assertion, * I didn't enable the `amdgpu` component in the `librustc_llvm` build script, * Add AMDGPU call abi info.
src/librustc_codegen_llvm/builder.rs
Outdated
@@ -564,6 +564,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { | |||
|
|||
|
|||
pub fn range_metadata(&self, load: ValueRef, range: Range<u128>) { | |||
if self.sess().target.target.arch == "amdgpu" { |
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.
Basically use a check like this instead of ignore_inline_never
. Both are LLVM bugs AFAICT.
@bors r- |
Triage: @DiamondLovesYou We haven't heard from you, Are you able to get back to this? |
Sorry, I've been out of the States for a while. I've returned but won't be all the way back home till Sunday. |
Triage: @DiamondLovesYou Hope your trip went well. Do you have any status updates on this PR? |
Allow target specs to disable that attribute.
d992a94
to
66e8e19
Compare
Ping from triage @eddyb! This PR needs your review. |
LGTM but deferring to @eddyb. |
Ping from triage @eddyb / @rust-lang/compiler: This PR requires your review. |
Sorry about the delay, was caught up in edition-related changes. @bors r+ |
📌 Commit 66e8e19 has been approved by |
Fix a few AMDGPU related issues * AMDGPU ignores `noinline` and sadly doesn't clear the attribute when it slaps `alwaysinline` on everything, * an AMDGPU related load bit range metadata assertion, * I didn't enable the `amdgpu` component in the `librustc_llvm` build script, * Add AMDGPU call abi info.
Rollup of 15 pull requests Successful merges: - #52514 (Fix a few AMDGPU related issues) - #53703 (Document .0 to unpack integer from Wrapping) - #53777 (Implemented map_or_else for Result<T, E>) - #54031 (A few cleanups and minor improvements to rustc_passes) - #54046 (Update documentation for fill_buf in std::io::BufRead) - #54064 (`&CStr`, not `CStr`, is the counterpart of `&str`) - #54072 (Stabilization change for mod.rs) - #54073 (docs: Use dollar sign for all bash prompts) - #54074 (simplify ordering for Kind) - #54085 (Remove documentation about proc_macro being bare-bones) - #54087 (rustdoc: Remove generated blanket impls from trait pages) - #54106 (Reexport CheckLintNameResult) - #54107 (Fix typos in libstd hash map) - #54136 (Update LLVM to fix GlobalISel dbg.declare) - #54142 (Recover proper regression test for issue #16278.) Failed merges: r? @ghost
noinline
and sadly doesn't clear the attribute when it slapsalwaysinline
on everything,amdgpu
component in thelibrustc_llvm
build script,