-
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
Fix stack probing for x32 #59674
Comments
Forgot to mention: I generated these files with |
If you haven't yet, you might try using |
Using bugpoint, i got this(I used llvm-dis to convert it to text):
|
Looks like it can't deal with the "probe-stack" attribute: removing that makes it work. My guess is the probe stack code doesn't do well with gnux32 targets which is 64bit but has 32bit pointers. The LLVM debug log re: why it fails:
|
Speaking of stack probing, I guess @Zoxc might know more about this? |
To unblock things, I think it is reasonable to delete |
I guess LLVM needs a upstream fix for stack probing on x32 (it probably emits code using 64-bit registers). We may also want a x32 specific stack probe function in https://github.com/rust-lang-nursery/compiler-builtins/blob/master/src/probestack.rs. |
I've pushed #59686 as the temporary workaround. |
Filed: |
Fixed upstream by llvm/llvm-project@b75c8fc. I believe a separate stack probing function for x32 is not necessary, the one for x86_64 should work fine. |
The LLVM fix is now in nightly, so we can try re-enabling this again. |
Revert "Disable stack probing for gnux32." This reverts commit 42d652e. (rust-lang#59686) Closes rust-lang#59674.
Revert "Disable stack probing for gnux32." This reverts commit 42d652e. (rust-lang#59686) Closes rust-lang#59674.
I've got a Rust minimal repro code (a.rs), its mir output (a.mir), its x86 codegen output (a.x86.ll) and its gnu-x32 codegen output (a.gnux32.ll) All these files are in this this gist.
Currently,
llc a.gnux32.ll
fails, saying "llvm error cannot emit physreg copy instruction".I don't understand llvm ir at all myself, but i tried commenting out L309, L311 & L314 out (all accessing a special 'variable?' called 'unsized_tmp') and
llc
it passes, then i uncomment L309 and llc fails again.This issue is blocking #59500. Maybe @eddyb, @oli-obk or someone else who's familiar with
rust/src/librustc_codegen_ssa/mir/operand.rs
could have a look or give me a hint about this?The text was updated successfully, but these errors were encountered: