-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
[RISCV] Miscompilation of inline assembly #100779
Comments
@llvm/issue-subscribers-backend-risc-v Author: None (shkoo)
It looks like LLC is miscompiling passing a register load to inline assembly:
Running llc on this crashes with assertions enabled (https://godbolt.org/z/1zWaoxKKE). Without assertions, it generates incorrect code (https://godbolt.org/z/43c4W44nY); notice that it silently discards the load of the low bits of using_inout: # @<!-- -->using_inout
lui a0, %hi(_ZN5repro9MY_BUFFER17hb0f674501d5980a6E)
ecall
ret This regression looks like it happened somewhere between llvm 17 (https://godbolt.org/z/o6eWGx68o) and llvm 18 (https://godbolt.org/z/fMMd9Gf3W). For more background, see rust-lang/rust#128212 |
…s register in a non-memory constraint. If the register is used by a non-memory constraint we should disable the fold. Otherwise, we may leave CommonOffset unassigned. Fixes llvm#100779.
/cherry-pick c901b73 |
…s register in a non-memory constraint. (llvm#100790) If the register is used by a non-memory constraint we should disable the fold. Otherwise, we may leave CommonOffset unassigned. Fixes llvm#100779. (cherry picked from commit c901b73)
/pull-request #100843 |
…s register in a non-memory constraint. (llvm#100790) If the register is used by a non-memory constraint we should disable the fold. Otherwise, we may leave CommonOffset unassigned. Fixes llvm#100779. (cherry picked from commit c901b73)
It looks like LLC is miscompiling passing a register load to inline assembly:
Running llc on this crashes with assertions enabled (https://godbolt.org/z/1zWaoxKKE).
Without assertions, it generates incorrect code (https://godbolt.org/z/43c4W44nY); notice that it silently discards the load of the low bits of
_ZN5repro9MY_BUFFER17hb0f674501d5980a6E
causing an incorrect value to be loaded in registera0
:This regression looks like it happened somewhere between llvm 17 (https://godbolt.org/z/o6eWGx68o) and llvm 18 (https://godbolt.org/z/fMMd9Gf3W).
For more background, see rust-lang/rust#128212
The text was updated successfully, but these errors were encountered: