[RISCV] Remove outdated c.lui rd, 0 to c.li rd, 0 rewriting. NFCI#1268
Open
Jonathon Penix (jonathonpenix) wants to merge 1 commit into
Open
[RISCV] Remove outdated c.lui rd, 0 to c.li rd, 0 rewriting. NFCI#1268Jonathon Penix (jonathonpenix) wants to merge 1 commit into
c.lui rd, 0 to c.li rd, 0 rewriting. NFCI#1268Jonathon Penix (jonathonpenix) wants to merge 1 commit into
Conversation
81df43b to
45f294d
Compare
45f294d to
2aae184
Compare
This code should be dead as `R_RISCV_RVC_LUI` is an internal relocation to help with relaxation and the only place we emit this relocation already checks that the immediate is non-zero. Cleaning this up is also helpful as a follow up patch will introduce a new internal relocation for `c.li` (for handling GOT load relaxations). The existing code is incorrect for that case, and cleaning this up will let us handle these two consistently (and more consistently with other instruction types). Signed-off-by: Jonathon Penix <jpenix@qti.qualcomm.com>
2aae184 to
762c841
Compare
Sudharsan Veeravalli (svs-quic)
approved these changes
Jun 22, 2026
Sudharsan Veeravalli (svs-quic)
left a comment
Contributor
There was a problem hiding this comment.
LGTM!
Shankar Easwaran (quic-seaswara)
requested changes
Jun 22, 2026
Shankar Easwaran (quic-seaswara)
left a comment
Contributor
There was a problem hiding this comment.
Prefer adding a build/run test to verify that the fix is good.
Shankar Easwaran (quic-seaswara)
left a comment
Contributor
There was a problem hiding this comment.
Can we also start adding a developer docs for relaxations which will be extremely helpful for RISC-V as a follow up ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This code should be dead as
R_RISCV_RVC_LUIis an internal relocation to help with relaxation and the only place we emit this relocation already checks that the immediate is non-zero.Cleaning this up is also helpful as a follow up patch will introduce a new internal relocation for
c.li(for handling GOT load relaxations). The existing code is incorrect for that case, and cleaning this up will let us handle these two consistently (and more consistently with other instruction types).