-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Meta LLVM codegen regression tracking issue #50422
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
Comments
I end up doing this quite often, and what I do is the following:
To generate LLVM-IR. There are a couple of things to keep in mind, and one typically needs to use them together:
Also, I recall reading somewhere that we are now shipping some of the llvm utilities, so one probably does not need to have a rustc compiled from source to use the appropriate versions of |
@gnzlbg awesome, thanks! Maybe we can move these notes to the rustc-guide or forge or something, so that we can point at them. |
|
@eddyb do you recall what it was? |
visiting for triage. These are some awesome notes from @gnzlbg . In order to get this bug out of my own issue queue, I'll try to recreate the steps listed and simultaneously port them into docs that we can put on the rustc-guide (or forge or something, as @nikomatsakis said...) |
@gnzlbg Sorry, no. Do you mean something like this? fn foo(x: Option<String>) -> String {
match x {
Some(s) => s,
None => unsafe { unreachable_unchecked() }
}
} This should generate code that's effectively an unchecked variant field access, |
Maybe, I can't recall any more :/ In any case when there is an issue in the rust book repo where people can submit their own tips and tricks for this: rust-lang/rustc-dev-guide#162 |
Visiting for triage: Given rust-lang/rustc-dev-guide#171, I am tempted to downgrade this to P-medium... |
visiting for triage and downgrading to P-medium, as I threatened last week. |
Removing I-unsound as this issue doesn't track a specific known soundness hole. |
This meta-issue hasn't had subissues in a long time, even though we've found LLVM regressions since 2020. I'm going to close this for now and we can continue using individual issues to track miscompilations and regressions. Happy to be convinced otherwise if anyone feels strongly. |
What is this bug?
From time to time, we encounter regressions that seem to be due to an LLVM misoptimization or other bug (though sometimes it's a case of invalid unsafe code, or rustc generating bad IR). In such cases, we try to narrow the problem down to some LLVM IR that shows the bug independent of Rust; this can then be filed with LLVM and tracked separately. This metabug serves to track those sorts of bugs, and specifically cases where we have not yet managed to create a reproducible test case.
Indications that a bug may fit this category
Guide to diagnosing
If you'd like to help out, @pnkfelix and @nagisa plan to write a guide for how to extract LLVM IR from rustc. It has sadly not yet been written.
Tracked issues
Integer::repr_discr
has transient ICE oncompile-fail/enum-discrim-too-small2.rs
heisenbug: debug buildsInteger::repr_discr
has transient ICE oncompile-fail/enum-discrim-too-small2.rs
#47381Priority
This bug is sometimes marked P-high when we find that there are a lot of such problems not yet diagnosed.
The text was updated successfully, but these errors were encountered: