Skip to content

[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
qualcomm:mainfrom
jonathonpenix:pr/no_ci_lui_rewrite
Open

[RISCV] Remove outdated c.lui rd, 0 to c.li rd, 0 rewriting. NFCI#1268
Jonathon Penix (jonathonpenix) wants to merge 1 commit into
qualcomm:mainfrom
jonathonpenix:pr/no_ci_lui_rewrite

Conversation

@jonathonpenix

Copy link
Copy Markdown
Contributor

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).

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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer adding a build/run test to verify that the fix is good.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also start adding a developer docs for relaxations which will be extremely helpful for RISC-V as a follow up ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants