-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Always specify llvm_abiname
for RISC-V targets
#131807
base: master
Are you sure you want to change the base?
Conversation
These commits modify compiler targets. |
This comment has been minimized.
This comment has been minimized.
03243c5
to
3ea91c0
Compare
I can't speak to the consequences of this PR, so I can't review it, sorry. All I am doing is going around and bothering everyone to get their ABIs in check, I don't actually know the technical details of how exactly to do that on each architecture. ;) r? compiler |
That sounds great! |
I think the answer is actually, surprisingly, that LLVM shrieks "DON'T!" at us. Obviously we have to actually reach codegen, but LLVM actually checks this sort of dependency for the RISCV backend. |
I wish that would be true. However, according to this, the answer is "Disabling target features required by the requested ABI will cause LLVM to ignore the ABI", which sounds less nice. |
Also we probably want to show a nicer error than have LLVM do error reporting. But it's always good to have a safety net :) |
Ah, yeah, I checked and the code that I thought might be there isn't. Sadness! |
Would it be worth asking LLVM to add such checks? For the arm backend at least that might actually be happening.
|
See <llvm/llvm-project#110383> for the arm issue.
|
I think we can make that happen, yeah. RISCV does some forms of feature dependency-checking already. |
For RISC-V targets, when
llvm_abiname
is not specified LLVM will infer the ABI from the target features, causing #116344 to occur. This PR adds the correctllvm_abiname
to all RISC-V targets where it is missing (which are all soft-float targets), and adds a test to prevent future RISC-V targets from accidentally omittingllvm_abiname
. The only affect of this PR is that-Ctarget-feature=+f
(or similar) will no longer affect the ABI on the modified targets.r? @RalfJung